当前位置: 首页>>代码示例>>C++>>正文


C++ CC4函数代码示例

本文整理汇总了C++中CC4函数的典型用法代码示例。如果您正苦于以下问题:C++ CC4函数的具体用法?C++ CC4怎么用?C++ CC4使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了CC4函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Detect_NonDirac

//---------------------------------------------------------------------------
bool File_Dirac::Detect_NonDirac ()
{
    //File_Size
    if (File_Size<188*4)
        return false; //We can't do detection

    //Element_Size
    if (Buffer_Size<188*4)
        return true; //Must wait for more data

    //Detect mainly DAT files, and the parser is not enough precise to detect them later
    if (CC4(Buffer)==CC4("RIFF"))
    {
        Finnished();
        return true;
    }

    //Detect TS files, and the parser is not enough precise to detect them later
    while (Buffer_Offset<188 && CC1(Buffer+Buffer_Offset)!=0x47) //Look for first Sync word
        Buffer_Offset++;
    if (Buffer_Offset<188 && CC1(Buffer+Buffer_Offset+188)==0x47 && CC1(Buffer+Buffer_Offset+188*2)==0x47 && CC1(Buffer+Buffer_Offset+188*3)==0x47)
    {
        Finnished();
        return true;
    }
    Buffer_Offset=0;

    //Seems OK
    return false;
}
开发者ID:thespooler,项目名称:mediainfo-code,代码行数:31,代码来源:File_Dirac.cpp

示例2: while

//---------------------------------------------------------------------------
bool File_Dirac::Synchronize()
{
    //Synchronizing
    while (Buffer_Offset+5<=Buffer_Size
        && CC4(Buffer+Buffer_Offset)!=0x42424344)  //"BBCD"
        Buffer_Offset++;
    if (Buffer_Offset+5>Buffer_Size)
    {
        //Parsing last bytes
        if (Buffer_Offset+4==Buffer_Size)
        {
            if (CC4(Buffer+Buffer_Offset)!=0x42424344)
            {
                Buffer_Offset++;
                if (CC3(Buffer+Buffer_Offset)!=0x424243)
                {
                    Buffer_Offset++;
                    if (CC2(Buffer+Buffer_Offset)!=0x4242)
                    {
                        Buffer_Offset++;
                        if (CC1(Buffer+Buffer_Offset)!=0x42)
                            Buffer_Offset++;
                    }
                }
            }
        }

        return false;
    }

    //Synched is OK
    Synched=true;
    return true;
}
开发者ID:thespooler,项目名称:mediainfo-code,代码行数:35,代码来源:File_Dirac.cpp

示例3: if

//---------------------------------------------------------------------------
void File_Aac::Read_Buffer_Continue ()
{
    //Tags
    if (File_Offset==0)
    {
        if (!Skip_ID3v2())
            return;
    }

    //Parsing headers
    if (Buffer_Size<=8)                                  ES();   //AAC in ES (.MP4)
    else if (CC4(Buffer)==CC4("ADIF"))                   ADIF(); //ADIF header
    else if ((CC2(Buffer+Buffer_Offset)&0xFFF6)==0xFFF0) ADTS(); //ADTS header (12 bits + ID + 2 bits)
    else if (CC3(Buffer)==CC3("AAC"))                    AAC();  //AAC header

    //No need of more
    File_Offset=File_Size;

    //Tags
    #if defined(MEDIAINFO_ID3_YES)
        /*
        File_Id3 Id3;
        if (Id3.Open(CompleteFileName)<0)
            Id3.Open(Buffer, Id3v2_Size);
        Merge(Id3);
        */
    #endif //ID3
}
开发者ID:aidv,项目名称:scripts,代码行数:29,代码来源:File_Aac.cpp

示例4: Header_Begin

//---------------------------------------------------------------------------
bool File_Wvpk::Header_Begin()
{
    //Specific cases
    if (FromMKV)
        return true;
        
    if (!File__Tags_Helper::Header_Begin())
        return false;

    //Must have enough buffer for having header
    if (Buffer_Offset+4>Buffer_Size)
        return false;

    //Quick test of synchro
    if (Synched && CC4(Buffer+Buffer_Offset)!=CC4("wvpk"))
    {
        Trusted_IsNot("WavPack, Synchronisation lost");
        Synched=false;
    }

    //Synchro
    if (!Synched && !Synchronize())
        return false;

    return true;
}
开发者ID:thespooler,项目名称:mediainfo-code,代码行数:27,代码来源:File_Wvpk.cpp

示例5: Get_C4

//---------------------------------------------------------------------------
void File_Jpeg::APP0()
{
    //Parsing
    int32u Name;
    Get_C4(Name,                                                "Name");
    if (Name==CC4("AVI1"))
        APP0_AVI1();
    if (Name==CC4("JFIF"))
        APP0_JFIF();
    if (Name==CC4("JFFF"))
        APP0_JFXX();
}
开发者ID:thespooler,项目名称:mediainfo-code,代码行数:13,代码来源:File_Jpeg.cpp

示例6: FileHeader_Begin

//---------------------------------------------------------------------------
bool File_Tiff::FileHeader_Begin()
{
    //Element_Size
    if (Buffer_Size<4)
        return false; //Must wait for more data
    if (CC4(Buffer)!=0x49492A00 && CC4(Buffer)!=0x4D4D002A)
    {
        Reject("TIFF");
        return false;
    }

    //All should be OK...
    return true;
}
开发者ID:thespooler,项目名称:mediainfo-code,代码行数:15,代码来源:File_Tiff.cpp

示例7: while

//---------------------------------------------------------------------------
bool File_Wvpk::Synchronize()
{
    //Specific case
    if (FromMKV)
        return true;

    //Tags
    bool Tag_Found;
    if (!File__Tags_Helper::Synchronize(Tag_Found))
        return false;
    if (Tag_Found)
        return true;

    //Synchronizing
    while (Buffer_Offset+8<=Buffer_Size)
    {
        while (Buffer_Offset+8<=Buffer_Size
            && CC4(Buffer+Buffer_Offset)!=CC4("wvpk"))
        {
            Buffer_Offset++;
        }

        if (Buffer_Offset+8<=Buffer_Size)//Testing if size is coherant
        {
            //Testing next start, to be sure
            size_t Size=LittleEndian2int32u(Buffer+Buffer_Offset+4)+8;
            if (Buffer_Offset+Size+8>Buffer_Size)
                return false; //Need more data

            //Testing
            if (CC4(Buffer+Buffer_Offset+Size)!=CC4("wvpk"))
                Buffer_Offset++;
            else
                break; //while()
        }
    }

    //Parsing last bytes if needed
    if (Buffer_Offset+8>Buffer_Size)
    {
        if (Buffer_Offset+7==Buffer_Size && CC4(Buffer+Buffer_Offset)!=0x7776706B) //"wvpk"
            Buffer_Offset++;
        if (Buffer_Offset+6==Buffer_Size && CC4(Buffer+Buffer_Offset)!=0x7776706B) //"wvpk"
            Buffer_Offset++;
        if (Buffer_Offset+5==Buffer_Size && CC4(Buffer+Buffer_Offset)!=0x7776706B) //"wvpk"
            Buffer_Offset++;
        if (Buffer_Offset+4==Buffer_Size && CC4(Buffer+Buffer_Offset)!=0x7776706B) //"wvpk"
            Buffer_Offset++;
        if (Buffer_Offset+3==Buffer_Size && CC3(Buffer+Buffer_Offset)!=0x777670)   //"wv"
            Buffer_Offset++;
        if (Buffer_Offset+2==Buffer_Size && CC2(Buffer+Buffer_Offset)!=0x7776)     //"wv"
            Buffer_Offset++;
        if (Buffer_Offset+1==Buffer_Size && CC1(Buffer+Buffer_Offset)!=0x77)       //"w"
            Buffer_Offset++;
        return false;
    }

    //Synched is OK
    return true;
}
开发者ID:thespooler,项目名称:mediainfo-code,代码行数:61,代码来源:File_Wvpk.cpp

示例8: Reject

//---------------------------------------------------------------------------
bool File_Png::FileHeader_Begin()
{
    //Element_Size
    if (Buffer_Size<8)
        return false; //Must wait for more data

    if (CC4(Buffer+4)!=0x0D0A1A0A) //Byte order
    {
        Reject("PNG");
        return false;
    }

    switch (CC4(Buffer)) //Signature
    {
        case 0x89504E47 :
            Accept("PNG");

            Fill(Stream_General, 0, General_Format, "PNG");
            Fill(StreamKind_Last, 0, Fill_Parameter(StreamKind_Last, Generic_Format), "PNG");
            Fill(StreamKind_Last, 0, Fill_Parameter(StreamKind_Last, Generic_Codec), "PNG");

            break;

        case 0x8A4E4E47 :
            Accept("PNG");

            Fill(Stream_General, 0, General_Format, "MNG");
            Fill(StreamKind_Last, 0, Fill_Parameter(StreamKind_Last, Generic_Format), "MNG");
            Fill(StreamKind_Last, 0, Fill_Parameter(StreamKind_Last, Generic_Codec), "MNG");

            Finish("PNG");
            break;

        case 0x8B4A4E47 :
            Accept("PNG");

            Fill(Stream_General, 0, General_Format, "JNG");
            Fill(StreamKind_Last, 0, Fill_Parameter(StreamKind_Last, Generic_Format), "JNG");
            Fill(StreamKind_Last, 0, Fill_Parameter(StreamKind_Last, Generic_Codec), "JNG");

            Finish("PNG");
            break;

        default:
            Reject("PNG");
    }

    //All should be OK...
    return true;
}
开发者ID:Chlara,项目名称:MediaConch,代码行数:51,代码来源:File_Png.cpp

示例9: while

//---------------------------------------------------------------------------
bool File_Cdxa::Synchronize()
{
    //Synchronizing
    while (           Buffer_Offset+2352*3+12<=Buffer_Size
      && !(CC8(Buffer+Buffer_Offset+2352*0)==0x00FFFFFFFFFFFFFFLL && CC4(Buffer+Buffer_Offset+2352*0+8)==0xFFFFFF00
        && CC8(Buffer+Buffer_Offset+2352*1)==0x00FFFFFFFFFFFFFFLL && CC4(Buffer+Buffer_Offset+2352*1+8)==0xFFFFFF00
        && CC8(Buffer+Buffer_Offset+2352*2)==0x00FFFFFFFFFFFFFFLL && CC4(Buffer+Buffer_Offset+2352*2+8)==0xFFFFFF00
        && CC8(Buffer+Buffer_Offset+2352*3)==0x00FFFFFFFFFFFFFFLL && CC4(Buffer+Buffer_Offset+2352*3+8)==0xFFFFFF00))
        Buffer_Offset++;
    if (Buffer_Offset+2352*3+12>Buffer_Size)
        return false;

    //Synched is OK
    return true;
}
开发者ID:Kyouju,项目名称:mpc-hc,代码行数:16,代码来源:File_Cdxa.cpp

示例10: while

//---------------------------------------------------------------------------
bool File_Dirac::Synchronize()
{
    //Synchronizing
    while (Buffer_Offset+5<=Buffer_Size
        && CC4(Buffer+Buffer_Offset)!=0x42424344)  //"BBCD"
        Buffer_Offset++;
    if (Buffer_Offset+5>Buffer_Size)
    {
        //Parsing last bytes
        if (Buffer_Offset+4==Buffer_Size)
        {
            if (CC4(Buffer+Buffer_Offset)!=0x42424344)
            {
                Buffer_Offset++;
                if (CC3(Buffer+Buffer_Offset)!=0x424243)
                {
                    Buffer_Offset++;
                    if (CC2(Buffer+Buffer_Offset)!=0x4242)
                    {
                        Buffer_Offset++;
                        if (CC1(Buffer+Buffer_Offset)!=0x42)
                            Buffer_Offset++;
                    }
                }
            }
        }

        return false;
    }

    //Synched is OK
    Synched=true;
    if (Streams.empty())
    {
        //Count of a Packets
        Frame_Count=0;

        //Temp
        Dirac_base_video_format((int32u)-1, frame_width, frame_height, chroma_format, source_sampling,
                                clean_width, clean_height, clean_left_offset, clean_top_offset,
                                frame_rate, pixel_aspect_ratio);

        //Default stream values
        Streams.resize(0x100);
        Streams[0x00].Searching_Payload=true; //Sequence header
    }
    return true;
}
开发者ID:thespooler,项目名称:mediainfo-code,代码行数:49,代码来源:File_Dirac.cpp

示例11: switch

//---------------------------------------------------------------------------
bool File_Aac::FileHeader_Begin()
{
    switch(Mode)
    {
        case Mode_AudioSpecificConfig :
        case Mode_ADIF                :
                                        MustSynchronize=false; break;
        default                       : ; //Synchronization is requested, and this is the default
    }

    switch(Mode)
    {
        case Mode_Unknown             :
        case Mode_ADIF                :
        case Mode_ADTS                :
                                        break;
        default                       : return true; //no file header test with other modes
    }

    //Tags
    if (!File__Tags_Helper::FileHeader_Begin())
        return false;

    //Testing
    if (Buffer_Offset+4>Buffer_Size)
        return false;
    if (CC4(Buffer+Buffer_Offset)==0x41444946) //"ADIF"
    {
        Mode=Mode_ADIF;
        File__Tags_Helper::Accept("ADIF");
        MustSynchronize=false;
    }

    return true;
}
开发者ID:DanHenebry,项目名称:mpc-hc,代码行数:36,代码来源:File_Aac.cpp

示例12: Header_Begin

//---------------------------------------------------------------------------
bool File_Dts::Header_Begin()
{
    //Must have enough buffer for having header
    if (Buffer_Offset+4>Buffer_Size)
        return false;

    //DTS-HD: Saving offset
    size_t DTS_HD_Offset=Buffer_Offset;

    //Quick test of synchro
    if (Synched && CC4(Buffer+Buffer_Offset)!=SyncCode)
    {
        Info("DTS, Synchronisation lost"); //Should not //TODO: find a better way to detect DTS
        Synched=false;
    }

    //Synchro
    if (!Synched && !Synchronize())
        return false;

    //DTS-HD: Saving difference
    if (Buffer_Offset-DTS_HD_Offset && Frame_Count>0)
        DTS_HD_Unknown_Size=Buffer_Offset-DTS_HD_Offset;

    //All should be OK...
    return true;
}
开发者ID:thespooler,项目名称:mediainfo-code,代码行数:28,代码来源:File_Dts.cpp

示例13: Header_Parse

//---------------------------------------------------------------------------
void File_Exr::Header_Parse()
{
    //Header
    if (CC4(Buffer+Buffer_Offset)==0x762F3101) //"v/1"+1
    {
        //Filling
        Header_Fill_Code(0, "File header");
        Header_Fill_Size(12);
        return;
    }

    //Image data
    if (name_End==0)
    {
        //Filling
        Header_Fill_Code(0, "Image data");
        Header_Fill_Size(ImageData_End-(File_Offset+Buffer_Offset));
        return;
    }
        
    int32u size;
    Get_String(name_End, name,                                  "name");
    Element_Offset++; //Null byte
    Get_String(type_End, type,                                  "type");
    Element_Offset++; //Null byte
    Get_L4 (size,                                               "size");
        
    //Filling
    Header_Fill_Code(0, Ztring().From_Local(name.c_str()));
    Header_Fill_Size(name_End+1+type_End+1+4+size);
}
开发者ID:Dimetro83,项目名称:DC_DDD,代码行数:32,代码来源:File_Exr.cpp

示例14: Detect_NonDTS

//---------------------------------------------------------------------------
bool File_Dts::Detect_NonDTS ()
{
    //Element_Size
    if (Buffer_Size<4)
        return true; //Must wait for more data

    //Detect WAV files, the parser can't detect it easily, there is only 70 bytes of begining for sayint WAV
    if (CC4(Buffer)==CC4("RIFF"))
    {
        Finnished();
        return true;
    }

    //Seems OK
    return false;
}
开发者ID:thespooler,项目名称:mediainfo-code,代码行数:17,代码来源:File_Dts.cpp

示例15: Skip_B1

//---------------------------------------------------------------------------
void File_Flac::FileHeader_Parse()
{
    //Parsing
    int32u Signature;
    if (VorbisHeader)
    {
        Skip_B1(                                                "Signature");
        Skip_Local(4,                                           "Signature");
        Skip_B1(                                                "Major version");
        Skip_B1(                                                "Minor version");
        Skip_B2(                                                "Number of header");
    }
    Get_C4 (Signature,                                          "Signature");

    FILLING_BEGIN();
        //Integrity
        if (Signature!=CC4("fLaC"))
        {
            Finished();
            return;
        }

        Stream_Prepare(Stream_General);
        Fill(Stream_General, 0, General_Format, "FLAC");
    FILLING_END();
}
开发者ID:thespooler,项目名称:mediainfo-code,代码行数:27,代码来源:File_Flac.cpp


注:本文中的CC4函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。