FFmpeg
|
#include "libavcodec/smpte_436m.h"
#include "bytestream.h"
#include "libavcodec/packet.h"
#include "libavutil/avassert.h"
#include "libavutil/error.h"
#include "libavutil/intreadwrite.h"
Go to the source code of this file.
Macros | |
#define | SMPTE_436M_ANC_ENTRY_HEADER_SIZE |
Functions | |
static int | validate_smpte_436m_anc_wrapping_type (AVSmpte436mWrappingType wrapping_type) |
static int | validate_smpte_436m_anc_payload_sample_coding (AVSmpte436mPayloadSampleCoding payload_sample_coding) |
int | av_smpte_436m_coded_anc_validate (const AVSmpte436mCodedAnc *anc) |
Validate a AVSmpte436mCodedAnc structure. More... | |
static int | smpte_436m_anc_decode_entry (const uint8_t *in, int size, AVSmpte436mCodedAnc *anc) |
Decode an ANC packet. More... | |
static int | smpte_436m_anc_encode_entry (uint8_t *out, int size, const AVSmpte436mCodedAnc *anc) |
Encode an ANC packet. More... | |
int | av_smpte_436m_anc_encode (uint8_t *out, int size, int anc_packet_count, const AVSmpte436mCodedAnc *anc_packets) |
Encode ANC packets into a single AV_CODEC_ID_SMPTE_436M_ANC AVPacket's data. More... | |
int | av_smpte_436m_anc_append (AVPacket *pkt, int anc_packet_count, const AVSmpte436mCodedAnc *anc_packets) |
Append more ANC packets to a single AV_CODEC_ID_SMPTE_436M_ANC AVPacket's data. More... | |
int | av_smpte_436m_anc_iter_init (AVSmpte436mAncIterator *iter, const uint8_t *buf, int buf_size) |
Set up iteration over the ANC packets in a single AV_CODEC_ID_SMPTE_436M_ANC AVPacket's data. More... | |
int | av_smpte_436m_anc_iter_next (AVSmpte436mAncIterator *iter, AVSmpte436mCodedAnc *anc) |
Get the next ANC packet from the iterator, advancing the iterator. More... | |
int | av_smpte_436m_coded_anc_payload_size (AVSmpte436mPayloadSampleCoding sample_coding, uint16_t sample_count) |
Get the minimum number of bytes needed to store a AVSmpte436mCodedAnc payload. More... | |
int | av_smpte_291m_anc_8bit_decode (AVSmpte291mAnc8bit *out, AVSmpte436mPayloadSampleCoding sample_coding, uint16_t sample_count, const uint8_t *payload, void *log_ctx) |
Decode a AVSmpte436mCodedAnc payload into AVSmpte291mAnc8bit. More... | |
void | av_smpte_291m_anc_8bit_fill_checksum (AVSmpte291mAnc8bit *anc) |
Fill in the correct checksum for a AVSmpte291mAnc8bit. More... | |
int | av_smpte_291m_anc_8bit_get_sample_count (const AVSmpte291mAnc8bit *anc, AVSmpte436mPayloadSampleCoding sample_coding, void *log_ctx) |
Compute the sample count needed to encode a AVSmpte291mAnc8bit into a AVSmpte436mCodedAnc payload. More... | |
int | av_smpte_291m_anc_8bit_encode (AVSmpte436mCodedAnc *out, uint16_t line_number, AVSmpte436mWrappingType wrapping_type, AVSmpte436mPayloadSampleCoding sample_coding, const AVSmpte291mAnc8bit *payload, void *log_ctx) |
Encode a AVSmpte291mAnc8bit into a AVSmpte436mCodedAnc. More... | |
int | av_smpte_291m_anc_8bit_extract_cta_708 (const AVSmpte291mAnc8bit *anc, uint8_t *cc_data, void *log_ctx) |
Try to decode an ANC packet into EIA-608/CTA-708 data (AV_CODEC_ID_EIA_608). More... | |
#define SMPTE_436M_ANC_ENTRY_HEADER_SIZE |
Definition at line 89 of file smpte_436m.c.
|
static |
Definition at line 29 of file smpte_436m.c.
Referenced by av_smpte_436m_coded_anc_validate().
|
static |
Definition at line 46 of file smpte_436m.c.
Referenced by av_smpte_436m_coded_anc_validate().
int av_smpte_436m_coded_anc_validate | ( | const AVSmpte436mCodedAnc * | anc | ) |
Validate a AVSmpte436mCodedAnc structure.
Doesn't check if the payload is valid.
[in] | anc | ANC packet to validate |
Definition at line 69 of file smpte_436m.c.
Referenced by smpte_436m_anc_decode_entry().
|
static |
Decode an ANC packet.
[in] | in | Input bytes. |
[in] | size | the size of in. |
[out] | anc | the decoded ANC packet |
Definition at line 105 of file smpte_436m.c.
Referenced by av_smpte_436m_anc_iter_next().
|
static |
Encode an ANC packet.
[in] | anc | the ANC packet to encode |
[in] | size | the size of out. ignored if out is NULL. |
[out] | out | Output bytes. Doesn't write anything if out is NULL. |
Definition at line 146 of file smpte_436m.c.
Referenced by av_smpte_436m_anc_append(), and av_smpte_436m_anc_encode().
int av_smpte_436m_anc_encode | ( | uint8_t * | out, |
int | size, | ||
int | anc_packet_count, | ||
const AVSmpte436mCodedAnc * | anc_packets | ||
) |
Encode ANC packets into a single AV_CODEC_ID_SMPTE_436M_ANC AVPacket's data.
[in] | anc_packet_count | number of ANC packets to encode |
[in] | anc_packets | the ANC packets to encode |
[in] | size | the size of out. ignored if out is NULL. |
[out] | out | Output bytes. Doesn't write anything if out is NULL. |
Definition at line 173 of file smpte_436m.c.
Referenced by ff_eia608_to_smpte436m_filter().
int av_smpte_436m_anc_append | ( | struct AVPacket * | pkt, |
int | anc_packet_count, | ||
const AVSmpte436mCodedAnc * | anc_packets | ||
) |
Append more ANC packets to a single AV_CODEC_ID_SMPTE_436M_ANC AVPacket's data.
[in] | anc_packet_count | number of ANC packets to encode |
[in] | anc_packets | the ANC packets to encode |
pkt | the AVPacket to append to. it must either be size 0 or contain valid SMPTE_436M_ANC data. |
Definition at line 201 of file smpte_436m.c.
Referenced by mcc_read_header().
int av_smpte_436m_anc_iter_init | ( | AVSmpte436mAncIterator * | iter, |
const uint8_t * | buf, | ||
int | buf_size | ||
) |
Set up iteration over the ANC packets in a single AV_CODEC_ID_SMPTE_436M_ANC AVPacket's data.
[in] | buf | Pointer to the data from a AV_CODEC_ID_SMPTE_436M_ANC AVPacket. |
[in] | buf_size | Size of the data from a AV_CODEC_ID_SMPTE_436M_ANC AVPacket. |
[out] | iter | Pointer to the iterator. |
Definition at line 234 of file smpte_436m.c.
Referenced by ff_smpte436m_to_eia608_filter(), and mcc_write_packet().
int av_smpte_436m_anc_iter_next | ( | AVSmpte436mAncIterator * | iter, |
AVSmpte436mCodedAnc * | anc | ||
) |
Get the next ANC packet from the iterator, advancing the iterator.
[in,out] | iter | Pointer to the iterator. |
[out] | anc | The returned ANC packet. |
Definition at line 250 of file smpte_436m.c.
Referenced by ff_smpte436m_to_eia608_filter(), and mcc_write_packet().
int av_smpte_436m_coded_anc_payload_size | ( | AVSmpte436mPayloadSampleCoding | sample_coding, |
uint16_t | sample_count | ||
) |
Get the minimum number of bytes needed to store a AVSmpte436mCodedAnc payload.
sample_coding | the payload sample coding |
sample_count | the number of samples stored in the payload |
Definition at line 265 of file smpte_436m.c.
Referenced by av_smpte_291m_anc_8bit_encode(), and av_smpte_436m_coded_anc_validate().
int av_smpte_291m_anc_8bit_decode | ( | AVSmpte291mAnc8bit * | out, |
AVSmpte436mPayloadSampleCoding | sample_coding, | ||
uint16_t | sample_count, | ||
const uint8_t * | payload, | ||
void * | log_ctx | ||
) |
Decode a AVSmpte436mCodedAnc payload into AVSmpte291mAnc8bit.
[in] | sample_coding | the payload sample coding |
[in] | sample_count | the number of samples stored in the payload |
[in] | payload | the bytes storing the payload, the needed size can be obtained from avpriv_smpte_436m_coded_anc_payload_size |
[in] | log_ctx | context pointer for av_log |
[out] | out | The decoded ANC packet. |
Definition at line 295 of file smpte_436m.c.
Referenced by ff_smpte436m_to_eia608_filter(), mcc_read_header(), and mcc_write_packet().
void av_smpte_291m_anc_8bit_fill_checksum | ( | AVSmpte291mAnc8bit * | anc | ) |
Fill in the correct checksum for a AVSmpte291mAnc8bit.
[in,out] | anc | The ANC packet. |
Definition at line 337 of file smpte_436m.c.
Referenced by av_smpte_291m_anc_8bit_decode(), and ff_eia608_to_smpte436m_filter().
int av_smpte_291m_anc_8bit_get_sample_count | ( | const AVSmpte291mAnc8bit * | anc, |
AVSmpte436mPayloadSampleCoding | sample_coding, | ||
void * | log_ctx | ||
) |
Compute the sample count needed to encode a AVSmpte291mAnc8bit into a AVSmpte436mCodedAnc payload.
[in] | anc | The ANC packet. |
[in] | sample_coding | The sample coding. |
[in] | log_ctx | context pointer for av_log |
Definition at line 346 of file smpte_436m.c.
Referenced by av_smpte_291m_anc_8bit_encode().
int av_smpte_291m_anc_8bit_encode | ( | AVSmpte436mCodedAnc * | out, |
uint16_t | line_number, | ||
AVSmpte436mWrappingType | wrapping_type, | ||
AVSmpte436mPayloadSampleCoding | sample_coding, | ||
const AVSmpte291mAnc8bit * | payload, | ||
void * | log_ctx | ||
) |
Encode a AVSmpte291mAnc8bit into a AVSmpte436mCodedAnc.
[in] | line_number | the line number the ANC packet is on |
[in] | wrapping_type | the wrapping type |
[in] | sample_coding | the payload sample coding |
[in] | payload | the ANC packet to encode. |
[in] | log_ctx | context pointer for av_log |
[out] | out | The encoded ANC packet. |
Definition at line 375 of file smpte_436m.c.
Referenced by ff_eia608_to_smpte436m_filter(), and ff_eia608_to_smpte436m_init().
int av_smpte_291m_anc_8bit_extract_cta_708 | ( | const AVSmpte291mAnc8bit * | anc, |
uint8_t * | cc_data, | ||
void * | log_ctx | ||
) |
Try to decode an ANC packet into EIA-608/CTA-708 data (AV_CODEC_ID_EIA_608).
This
[in] | anc | The ANC packet. |
[in] | log_ctx | Context pointer for av_log |
[out] | cc_data | the buffer to store the extracted EIA-608/CTA-708 data, you can pass NULL to not store the data. the required size is 3 * cc_count bytes. SMPTE_291M_ANC_PAYLOAD_CAPACITY is always enough size. |
Definition at line 433 of file smpte_436m.c.
Referenced by ff_smpte436m_to_eia608_filter(), and mcc_read_header().