MP4v2

streaming.h
1#ifndef MP4V2_STREAMING_H
2#define MP4V2_STREAMING_H
3
4/**************************************************************************/
45MP4V2_EXPORT
46 bool MP4GetHintTrackRtpPayload(
47 MP4FileHandle hFile,
48 MP4TrackId hintTrackId,
49 char** ppPayloadName DEFAULT(NULL),
50 uint8_t* pPayloadNumber DEFAULT(NULL),
51 uint16_t* pMaxPayloadSize DEFAULT(NULL),
52 char** ppEncodingParams DEFAULT(NULL) );
53
54#define MP4_SET_DYNAMIC_PAYLOAD 0xff
55
106MP4V2_EXPORT
107 bool MP4SetHintTrackRtpPayload(
108 MP4FileHandle hFile,
109 MP4TrackId hintTrackId,
110 const char* pPayloadName,
111 uint8_t* pPayloadNumber,
112 uint16_t maxPayloadSize DEFAULT(0),
113 const char * encode_params DEFAULT(NULL),
114 bool include_rtp_map DEFAULT(true),
115 bool include_mpeg4_esid DEFAULT(true) );
116
134MP4V2_EXPORT
135 const char* MP4GetSessionSdp(
136 MP4FileHandle hFile );
137
152MP4V2_EXPORT
153 bool MP4SetSessionSdp(
154 MP4FileHandle hFile,
155 const char* sdpString );
156
172MP4V2_EXPORT
173 bool MP4AppendSessionSdp(
174 MP4FileHandle hFile,
175 const char* sdpString );
176
197MP4V2_EXPORT
198 const char* MP4GetHintTrackSdp(
199 MP4FileHandle hFile,
200 MP4TrackId hintTrackId );
201
217MP4V2_EXPORT
218 bool MP4SetHintTrackSdp(
219 MP4FileHandle hFile,
220 MP4TrackId hintTrackId,
221 const char* sdpString );
222
239MP4V2_EXPORT
240 bool MP4AppendHintTrackSdp(
241 MP4FileHandle hFile,
242 MP4TrackId hintTrackId,
243 const char* sdpString );
244
258MP4V2_EXPORT
259MP4TrackId MP4GetHintTrackReferenceTrackId(
260 MP4FileHandle hFile,
261 MP4TrackId hintTrackId );
262
287MP4V2_EXPORT
288 bool MP4ReadRtpHint(
289 MP4FileHandle hFile,
290 MP4TrackId hintTrackId,
291 MP4SampleId hintSampleId,
292 uint16_t* pNumPackets DEFAULT(NULL) );
293
307MP4V2_EXPORT
308uint16_t MP4GetRtpHintNumberOfPackets(
309 MP4FileHandle hFile,
310 MP4TrackId hintTrackId );
311
327MP4V2_EXPORT
328int8_t MP4GetRtpPacketBFrame(
329 MP4FileHandle hFile,
330 MP4TrackId hintTrackId,
331 uint16_t packetIndex );
332
351MP4V2_EXPORT
352int32_t MP4GetRtpPacketTransmitOffset(
353 MP4FileHandle hFile,
354 MP4TrackId hintTrackId,
355 uint16_t packetIndex );
356
415MP4V2_EXPORT
416 bool MP4ReadRtpPacket(
417 MP4FileHandle hFile,
418 MP4TrackId hintTrackId,
419 uint16_t packetIndex,
420 uint8_t** ppBytes,
421 uint32_t* pNumBytes,
422 uint32_t ssrc DEFAULT(0),
423 bool includeHeader DEFAULT(true),
424 bool includePayload DEFAULT(true) );
425
450MP4V2_EXPORT
451MP4Timestamp MP4GetRtpTimestampStart(
452 MP4FileHandle hFile,
453 MP4TrackId hintTrackId );
454
474MP4V2_EXPORT
475 bool MP4SetRtpTimestampStart(
476 MP4FileHandle hFile,
477 MP4TrackId hintTrackId,
478 MP4Timestamp rtpStart );
479
495MP4V2_EXPORT
496 bool MP4AddRtpHint(
497 MP4FileHandle hFile,
498 MP4TrackId hintTrackId );
499
536MP4V2_EXPORT
537 bool MP4AddRtpVideoHint(
538 MP4FileHandle hFile,
539 MP4TrackId hintTrackId,
540 bool isBFrame DEFAULT(false),
541 uint32_t timestampOffset DEFAULT(0) );
542
567MP4V2_EXPORT
568 bool MP4AddRtpPacket(
569 MP4FileHandle hFile,
570 MP4TrackId hintTrackId,
571 bool setMBit DEFAULT(false),
572 int32_t transmitOffset DEFAULT(0) );
573
594MP4V2_EXPORT
595 bool MP4AddRtpImmediateData(
596 MP4FileHandle hFile,
597 MP4TrackId hintTrackId,
598 const uint8_t* pBytes,
599 uint32_t numBytes );
600
621MP4V2_EXPORT
622 bool MP4AddRtpSampleData(
623 MP4FileHandle hFile,
624 MP4TrackId hintTrackId,
625 MP4SampleId sampleId,
626 uint32_t dataOffset,
627 uint32_t dataLength );
628
643MP4V2_EXPORT
644 bool MP4AddRtpESConfigurationPacket(
645 MP4FileHandle hFile,
646 MP4TrackId hintTrackId );
647
667MP4V2_EXPORT
668 bool MP4WriteRtpHint(
669 MP4FileHandle hFile,
670 MP4TrackId hintTrackId,
671 MP4Duration duration,
672 bool isSyncSample DEFAULT(true) );
673
676#endif /* MP4V2_STREAMING_H */
MP4ReadRtpPacket
bool MP4ReadRtpPacket(MP4FileHandle hFile, MP4TrackId hintTrackId, uint16_t packetIndex, uint8_t **ppBytes, uint32_t *pNumBytes, uint32_t ssrc=0, bool includeHeader=true, bool includePayload=true)
Read an RTP packet.
MP4AddRtpHint
bool MP4AddRtpHint(MP4FileHandle hFile, MP4TrackId hintTrackId)
Add an RTP hint.
MP4SetHintTrackSdp
bool MP4SetHintTrackSdp(MP4FileHandle hFile, MP4TrackId hintTrackId, const char *sdpString)
Set the SDP media level description of the hint track.
MP4AppendHintTrackSdp
bool MP4AppendHintTrackSdp(MP4FileHandle hFile, MP4TrackId hintTrackId, const char *sdpString)
Add to the SDP media level description of the hint track.
MP4GetHintTrackSdp
const char * MP4GetHintTrackSdp(MP4FileHandle hFile, MP4TrackId hintTrackId)
Get the SDP media level description associated with a hint track.
MP4SetHintTrackRtpPayload
bool MP4SetHintTrackRtpPayload(MP4FileHandle hFile, MP4TrackId hintTrackId, const char *pPayloadName, uint8_t *pPayloadNumber, uint16_t maxPayloadSize=0, const char *encode_params=NULL, bool include_rtp_map=true, bool include_mpeg4_esid=true)
Set the RTP payload parameters of the hint track.
MP4GetHintTrackReferenceTrackId
MP4TrackId MP4GetHintTrackReferenceTrackId(MP4FileHandle hFile, MP4TrackId hintTrackId)
Get the reference track id for a hint track.
MP4SetSessionSdp
bool MP4SetSessionSdp(MP4FileHandle hFile, const char *sdpString)
Set the SDP session level description of the file.
MP4AddRtpVideoHint
bool MP4AddRtpVideoHint(MP4FileHandle hFile, MP4TrackId hintTrackId, bool isBFrame=false, uint32_t timestampOffset=0)
Add an RTP video specific hint.
MP4GetRtpPacketTransmitOffset
int32_t MP4GetRtpPacketTransmitOffset(MP4FileHandle hFile, MP4TrackId hintTrackId, uint16_t packetIndex)
Get the transmit offset of an RTP packet.
MP4GetHintTrackRtpPayload
bool MP4GetHintTrackRtpPayload(MP4FileHandle hFile, MP4TrackId hintTrackId, char **ppPayloadName=NULL, uint8_t *pPayloadNumber=NULL, uint16_t *pMaxPayloadSize=NULL, char **ppEncodingParams=NULL)
Get the RTP payload parameters of the hint track.
MP4AddRtpPacket
bool MP4AddRtpPacket(MP4FileHandle hFile, MP4TrackId hintTrackId, bool setMBit=false, int32_t transmitOffset=0)
Add an RTP packet.
MP4WriteRtpHint
bool MP4WriteRtpHint(MP4FileHandle hFile, MP4TrackId hintTrackId, MP4Duration duration, bool isSyncSample=true)
Write an RTP hint.
MP4ReadRtpHint
bool MP4ReadRtpHint(MP4FileHandle hFile, MP4TrackId hintTrackId, MP4SampleId hintSampleId, uint16_t *pNumPackets=NULL)
Read an RTP hint.
MP4AddRtpESConfigurationPacket
bool MP4AddRtpESConfigurationPacket(MP4FileHandle hFile, MP4TrackId hintTrackId)
Add ES configuration information to an RTP hint.
MP4AppendSessionSdp
bool MP4AppendSessionSdp(MP4FileHandle hFile, const char *sdpString)
Add to the SDP session level description of the file.
MP4AddRtpSampleData
bool MP4AddRtpSampleData(MP4FileHandle hFile, MP4TrackId hintTrackId, MP4SampleId sampleId, uint32_t dataOffset, uint32_t dataLength)
Add media sample data to an RTP packet.
MP4GetRtpTimestampStart
MP4Timestamp MP4GetRtpTimestampStart(MP4FileHandle hFile, MP4TrackId hintTrackId)
Get the RTP start time of a hint track.
MP4AddRtpImmediateData
bool MP4AddRtpImmediateData(MP4FileHandle hFile, MP4TrackId hintTrackId, const uint8_t *pBytes, uint32_t numBytes)
Add immediate data to an RTP packet.
MP4GetRtpHintNumberOfPackets
uint16_t MP4GetRtpHintNumberOfPackets(MP4FileHandle hFile, MP4TrackId hintTrackId)
Get the number of packets in an RTP hint.
MP4GetRtpPacketBFrame
int8_t MP4GetRtpPacketBFrame(MP4FileHandle hFile, MP4TrackId hintTrackId, uint16_t packetIndex)
Get the B frame flag of an RTP packet.
MP4SetRtpTimestampStart
bool MP4SetRtpTimestampStart(MP4FileHandle hFile, MP4TrackId hintTrackId, MP4Timestamp rtpStart)
Get the RTP start time of a hint track.
MP4GetSessionSdp
const char * MP4GetSessionSdp(MP4FileHandle hFile)
Get the SDP session level description of the file.