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


C++ AP4_FAILED函数代码示例

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


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


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