• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ AP4_FAILED函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1:

/*----------------------------------------------------------------------
|   AP4_FileByteStream::AP4_FileByteStream
+---------------------------------------------------------------------*/
AP4_FileByteStream::AP4_FileByteStream(const char*              name, 
                                       AP4_FileByteStream::Mode mode)
{
    AP4_ByteStream* stream = NULL;
    AP4_Result result = AP4_KodiFileByteStream::Create(this, name, mode, stream);
    if (AP4_FAILED(result)) throw AP4_Exception(result);
    
    m_Delegate = stream;
}
开发者ID:xbmcin,项目名称:XBMCinTC,代码行数:12,代码来源:Ap4KodiFileByteStream.cpp


示例2:

/*----------------------------------------------------------------------
|   AP4_DecryptingSampleReader::ReadSampleData
+---------------------------------------------------------------------*/
AP4_Result 
AP4_DecryptingSampleReader::ReadSampleData(AP4_Sample&     sample, 
                                           AP4_DataBuffer& sample_data)
{
    AP4_Result result = sample.ReadData(m_DataBuffer);
    if (AP4_FAILED(result)) return result;

    return m_Decrypter->DecryptSampleData(m_DataBuffer, sample_data);
}
开发者ID:fritsch,项目名称:inputstream.mpd,代码行数:12,代码来源:Ap4LinearReader.cpp


示例3:

/*----------------------------------------------------------------------
|   AP4_OdafAtom::Create
+---------------------------------------------------------------------*/
AP4_OdafAtom*
AP4_OdafAtom::Create(AP4_Size size, AP4_ByteStream& stream)
{
    AP4_UI08 version;
    AP4_UI32 flags;
    if (AP4_FAILED(AP4_Atom::ReadFullHeader(stream, version, flags))) return NULL;
    if (version != 0) return NULL;
    return new AP4_OdafAtom(size, version, flags, stream);
}
开发者ID:satram,项目名称:Bento4,代码行数:12,代码来源:Ap4OdafAtom.cpp


示例4:

/*----------------------------------------------------------------------
|   AP4_TfhdAtom::Create
+---------------------------------------------------------------------*/
AP4_TfhdAtom*
AP4_TfhdAtom::Create(AP4_Size size, AP4_ByteStream& stream)
{
    AP4_UI32 version;
    AP4_UI32 flags;
    if (AP4_FAILED(AP4_Atom::ReadFullHeader(stream, version, flags))) return NULL;
    if (version > 0) return NULL;
    if (size != ComputeSize(flags)) return NULL;
    return new AP4_TfhdAtom(size, version, flags, stream);
}
开发者ID:Fluffiest,项目名称:mpc-hc,代码行数:13,代码来源:Ap4TfhdAtom.cpp


示例5:

/*----------------------------------------------------------------------
|   AP4_BlocAtom::Create
+---------------------------------------------------------------------*/
AP4_BlocAtom*
AP4_BlocAtom::Create(AP4_Size size, AP4_ByteStream& stream)
{
    AP4_UI08 version;
    AP4_UI32 flags;
    if (size < AP4_FULL_ATOM_HEADER_SIZE) return NULL;
    if (AP4_FAILED(AP4_Atom::ReadFullHeader(stream, version, flags))) return NULL;
    if (version > 1) return NULL;
    return new AP4_BlocAtom(size, version, flags, stream);
}
开发者ID:lookback,项目名称:Bento4,代码行数:13,代码来源:Ap4BlocAtom.cpp


示例6: ReadFullHeader

/*----------------------------------------------------------------------
|   AP4_PiffTrackEncryptionAtom::Create
+---------------------------------------------------------------------*/
AP4_PiffTrackEncryptionAtom* 
AP4_PiffTrackEncryptionAtom::Create(AP4_Size size, AP4_ByteStream& stream)
{
    AP4_UI08 version = 0;
    AP4_UI32 flags   = 0;
    AP4_Result result = ReadFullHeader(stream, version, flags);
    if (AP4_FAILED(result)) return NULL;
    if (version != 0) return NULL;
    return new AP4_PiffTrackEncryptionAtom(size, version, flags, stream);
}
开发者ID:AchimTuran,项目名称:inputstream.mpd,代码行数:13,代码来源:Ap4Piff.cpp


示例7: while

/*----------------------------------------------------------------------
|       AP4_RtpAtom::WriteFields
+---------------------------------------------------------------------*/
AP4_Result
AP4_RtpAtom::WriteFields(AP4_ByteStream& stream)
{
    AP4_Result result;

    // description format
    result = stream.WriteUI32(m_DescriptionFormat);
    if (AP4_FAILED(result)) return result;

    // sdp text
    result = stream.Write(m_SdpText.c_str(), m_SdpText.length());
    if (AP4_FAILED(result)) return result;

    // pad with zeros if necessary
    AP4_Size padding = m_Size-(AP4_ATOM_HEADER_SIZE+4+m_SdpText.length());
    while (padding--) stream.WriteUI08(0);
    
    return AP4_SUCCESS;
}
开发者ID:334151798,项目名称:dwindow,代码行数:22,代码来源:Ap4RtpAtom.cpp


示例8:

/*----------------------------------------------------------------------
|       AP4_IsmaTrackEncrypter::ProcessSample
+---------------------------------------------------------------------*/
AP4_Result 
AP4_IsmaTrackEncrypter::ProcessSample(AP4_DataBuffer& data_in,
                                      AP4_DataBuffer& data_out)
{
    AP4_Result result = m_Cipher->EncryptSample(data_in, data_out, m_ByteOffset, false);
    if (AP4_FAILED(result)) return result;

    m_ByteOffset += data_in.GetDataSize();
    return AP4_SUCCESS;
}
开发者ID:AeonAxan,项目名称:mpc-hc,代码行数:13,代码来源:Ap4IsmaCryp.cpp


示例9: SetEncryptedPayload

/*----------------------------------------------------------------------
|   AP4_OddaAtom::SetEncryptedPayload
+---------------------------------------------------------------------*/
AP4_Result
AP4_OddaAtom::SetEncryptedPayload(AP4_ByteStream& stream)
{
    // the new encrypted data length is the size of the stream
    AP4_LargeSize length;
    AP4_Result result = stream.GetSize(length);
    if (AP4_FAILED(result)) return result;

    return SetEncryptedPayload(stream, length);
}
开发者ID:satram,项目名称:Bento4,代码行数:13,代码来源:Ap4OddaAtom.cpp


示例10:

/*----------------------------------------------------------------------
|   AP4_UnknownSampleEntry::ReadFields
+---------------------------------------------------------------------*/
AP4_Result
AP4_UnknownSampleEntry::ReadFields(AP4_ByteStream& stream)
{
    // sample entry
    AP4_Result result = AP4_SampleEntry::ReadFields(stream);
    if (AP4_FAILED(result)) return result;
    
    // read the payload
    return stream.Read(m_Payload.UseData(), m_Payload.GetDataSize());
}
开发者ID:qmwd2006,项目名称:bento4,代码行数:13,代码来源:Ap4SampleEntry.cpp


示例11: AP4_Movie_GetTrackByIndex

AP4_Track*
AP4_Movie_GetTrackByIndex(AP4_Movie* self, AP4_Ordinal index)
{
    AP4_Track* track = NULL;
    if (AP4_FAILED(self->GetTracks().Get(index, track))) {
        return NULL;
    } else {
        return track;
    }
}
开发者ID:ehamine,项目名称:Bento4,代码行数:10,代码来源:Bento4C.cpp


示例12:

/*----------------------------------------------------------------------
|       AP4_IsfmAtom::WriteFields
+---------------------------------------------------------------------*/
AP4_Result
AP4_IsfmAtom::WriteFields(AP4_ByteStream& stream)
{
    AP4_Result result;

    // selective encryption
    result = stream.WriteUI08(m_SelectiveEncryption ? 1 : 0);
    if (AP4_FAILED(result)) return result;

    // key indicator length
    result = stream.WriteUI08(m_KeyIndicatorLength);
    if (AP4_FAILED(result)) return result;

    // IV length
    result = stream.WriteUI08(m_IvLength);
    if (AP4_FAILED(result)) return result;

    return AP4_SUCCESS;
}
开发者ID:334151798,项目名称:dwindow,代码行数:22,代码来源:Ap4IsfmAtom.cpp


示例13: switch

/*----------------------------------------------------------------------
|   AP4_Expandable::Write
+---------------------------------------------------------------------*/
AP4_Result
AP4_Expandable::Write(AP4_ByteStream& stream)
{
    AP4_Result result;

    // write the class id
    switch (m_ClassIdSize) {
        case CLASS_ID_SIZE_08:
            result = stream.WriteUI08((AP4_UI08)m_ClassId);
            if (AP4_FAILED(result)) return result;
            break;
        
        default:
            return AP4_ERROR_INTERNAL;
    }
    
    // write the size
    AP4_ASSERT(m_HeaderSize-1 <= 8);
    AP4_ASSERT(m_HeaderSize >= 2);
    unsigned int size = m_PayloadSize;
    unsigned char bytes[8];

    // last bytes of the encoded size
    bytes[m_HeaderSize-2] = size&0x7F;

    // leading bytes of the encoded size
    for (int i=m_HeaderSize-3; i>=0; i--) {
        // move to the next 7 bits
        size >>= 7;

        // output a byte with a top bit marker
        bytes[i] = (size&0x7F) | 0x80;
    }

    result = stream.Write(bytes, m_HeaderSize-1);
    if (AP4_FAILED(result)) return result;

    // write the fields
    WriteFields(stream);

    return result;
}
开发者ID:9aa5,项目名称:Bento4,代码行数:45,代码来源:Ap4Expandable.cpp


示例14:

/*----------------------------------------------------------------------
|   AP4_StsdAtom::Create
+---------------------------------------------------------------------*/
AP4_StsdAtom*
AP4_StsdAtom::Create(AP4_Size         size, 
                     AP4_ByteStream&  stream, 
                     AP4_AtomFactory& atom_factory)
{
    AP4_UI08 version;
    AP4_UI32 flags;
    if (AP4_FAILED(AP4_Atom::ReadFullHeader(stream, version, flags))) return NULL;
    if (version > 1) return NULL;
    return new AP4_StsdAtom(size, version, flags, stream, atom_factory);
}
开发者ID:AchimTuran,项目名称:inputstream.mpd,代码行数:14,代码来源:Ap4StsdAtom.cpp


示例15: CreateAtomFromStream

/*----------------------------------------------------------------------
|       AP4_AtomFactory::CreateAtomFromStream
+---------------------------------------------------------------------*/
AP4_Result
AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream& stream, 
                                      AP4_Atom*&      atom)
{
    AP4_Size bytes_available = 0;
    if (AP4_FAILED(stream.GetSize(bytes_available)) ||
        bytes_available == 0) {
        bytes_available = (AP4_Size)((unsigned long)(-1));
    }
    return CreateAtomFromStream(stream, bytes_available, atom, NULL);
}
开发者ID:AeonAxan,项目名称:mpc-hc,代码行数:14,代码来源:Ap4AtomFactory.cpp


示例16: defined

/*----------------------------------------------------------------------
|   AP4::Initialize
+---------------------------------------------------------------------*/
AP4_Result
AP4::Initialize()
{
    AP4_Result result = AP4_SUCCESS;
#if defined(AP4_CONFIG_CONSTRUCT_STATICS_ON_INITIALIZE)
    if (!AP4_DefaultAtomFactory::Instance.m_Initialized) {
        result = AP4_DefaultAtomFactory::Instance.Initialize();
        if (AP4_FAILED(result)) return result;
    }
    if (!AP4_DefaultBlockCipherFactory::Instance.m_Initialized) {
        result = AP4_DefaultBlockCipherFactory::Instance.Initialize();
        if (AP4_FAILED(result)) return result;
    }
    if (!AP4_MetaData::Initialized()) {
        AP4_MetaData::Initialize();
    }
#endif
    
    return result;
}
开发者ID:9aa5,项目名称:Bento4,代码行数:23,代码来源:Ap4.cpp


示例17: IsIFrame

/*----------------------------------------------------------------------
|   IsIFrame
+---------------------------------------------------------------------*/
static bool
IsIFrame(AP4_Sample& sample, AP4_AvcSampleDescription* avc_desc) {
    AP4_DataBuffer sample_data;
    if (AP4_FAILED(sample.ReadData(sample_data))) {
        return false;
    }

    const unsigned char* data = sample_data.GetData();
    AP4_Size             size = sample_data.GetDataSize();

    while (size >= avc_desc->GetNaluLengthSize()) {
        unsigned int nalu_length = 0;
        if (avc_desc->GetNaluLengthSize() == 1) {
            nalu_length = *data++;
            --size;
        } else if (avc_desc->GetNaluLengthSize() == 2) {
            nalu_length = AP4_BytesToUInt16BE(data);
            data += 2;
            size -= 2;
        } else if (avc_desc->GetNaluLengthSize() == 4) {
            nalu_length = AP4_BytesToUInt32BE(data);
            data += 4;
            size -= 4;
        } else {
            return false;
        }
        if (nalu_length <= size) {
            size -= nalu_length;
        } else {
            size = 0;
        }
        
        switch (*data & 0x1F) {
            case 1: {
                AP4_BitStream bits;
                bits.WriteBytes(data+1, 8);
                ReadGolomb(bits);
                unsigned int slice_type = ReadGolomb(bits);
                if (slice_type == 2 || slice_type == 7) {
                    return true;
                } else {
                    return false; // only show first slice type
                }
            }
            
            case 5: 
                return true;
        }
        
        data += nalu_length;
    }
 
    return false;
}
开发者ID:garybruckheimer,项目名称:raypackSuite,代码行数:57,代码来源:Mp4Fragment.cpp


示例18:

/*----------------------------------------------------------------------
|       AP4_SampleRtpConstructor::DoWrite
+---------------------------------------------------------------------*/
AP4_Result
AP4_SampleRtpConstructor::DoWrite(AP4_ByteStream& stream)
{
    AP4_Result result = stream.WriteUI08(m_TrackRefIndex);
    if (AP4_FAILED(result)) return result;

    result = stream.WriteUI16(m_Length);
    if (AP4_FAILED(result)) return result;

    result = stream.WriteUI32(m_SampleNum);
    if (AP4_FAILED(result)) return result;

    result = stream.WriteUI32(m_SampleOffset);
    if (AP4_FAILED(result)) return result;

    result = stream.WriteUI16(1); // bytes per block
    if (AP4_FAILED(result)) return result;

    return stream.WriteUI16(1); // samples per block
}
开发者ID:AeonAxan,项目名称:mpc-hc,代码行数:23,代码来源:Ap4RtpHint.cpp


示例19: main

/*----------------------------------------------------------------------
|       main
+---------------------------------------------------------------------*/
int
main(int argc, char** argv)
{
    AP4_Result result = AP4_SUCCESS;

    // parse the command line
    if (argc != 2) PrintUsageAndExit();

    // create the input stream
    AP4_ByteStream* input;
    try {
        input = new AP4_FileByteStream(argv[1],
            AP4_FileByteStream::STREAM_MODE_READ);
    } catch (AP4_Exception) {
        fprintf(stderr, "ERROR: cannot open input file (%s)\n", argv[1]);
        return 1;
    }

    AP4_File* file = new AP4_File(*input);
  

    AP4_Movie* movie = file->GetMovie();
    if (movie != NULL) {
        // get a hint track reader
        AP4_Track* hint_track = movie->GetTrack(AP4_Track::TYPE_HINT, 1);
        if (hint_track == NULL) {
            AP4_Debug("No hint track in this movie\n");
            return AP4_FAILURE;
        }
        AP4_HintTrackReader reader(*hint_track, *movie, 0x01020304);
        AP4_String rtp_file_name(argv[1]);
        rtp_file_name += ".rtp";

        // display the sdp
        AP4_String sdp;
        reader.GetSdpText(sdp);
        AP4_Debug("sdp:\n%s\n\n", sdp.c_str());

        // dump the packet
        result = DumpRtpPackets(reader, rtp_file_name.c_str());
        if (AP4_FAILED(result)) goto bail;

    } else {
        AP4_Debug("No movie found in the file\n");
        return AP4_FAILURE;
    }

bail:
    delete file;
    input->Release();

    return result;
}
开发者ID:Fluffiest,项目名称:splayer,代码行数:56,代码来源:Mp4RtpHintInfo.cpp


示例20:

/*----------------------------------------------------------------------
|       AP4_DrefAtom::WriteFields
+---------------------------------------------------------------------*/
AP4_Result
AP4_DrefAtom::WriteFields(AP4_ByteStream& stream)
{
    AP4_Result result;

    // write the number of entries
    result = stream.WriteUI32(m_Children.ItemCount());
    if (AP4_FAILED(result)) return result;

    // write the children
    return m_Children.Apply(AP4_AtomListWriter(stream));
}
开发者ID:334151798,项目名称:dwindow,代码行数:15,代码来源:Ap4DrefAtom.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ AP4_SUCCEEDED函数代码示例发布时间:2022-05-30
下一篇:
C++ AP4_DYNAMIC_CAST函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap