#include "movenc.h"
#include "libavutil/intreadwrite.h"
Go to the source code of this file.
Functions | |
int | ff_mov_init_hinting (AVFormatContext *s, int index, int src_index) |
static void | sample_queue_pop (HintSampleQueue *queue) |
Remove the first sample from the sample queue. | |
static void | sample_queue_free (HintSampleQueue *queue) |
Empty the sample queue, releasing all memory. | |
static void | sample_queue_push (HintSampleQueue *queue, AVPacket *pkt, int sample) |
Add a reference to the sample data to the sample queue. | |
static void | sample_queue_retain (HintSampleQueue *queue) |
Make local copies of all referenced sample data in the queue. | |
static int | match_segments (const uint8_t *haystack, int h_len, const uint8_t *needle, int n_pos, int n_len, int *match_h_offset_ptr, int *match_n_offset_ptr, int *match_len_ptr) |
Find matches of needle[n_pos ->] within haystack. | |
static int | find_sample_match (const uint8_t *data, int len, HintSampleQueue *queue, int *pos, int *match_sample, int *match_offset, int *match_len) |
Look for segments in samples in the sample queue matching the data in ptr. | |
static void | output_immediate (const uint8_t *data, int size, ByteIOContext *out, int *entries) |
static void | output_match (ByteIOContext *out, int match_sample, int match_offset, int match_len, int *entries) |
static void | describe_payload (const uint8_t *data, int size, ByteIOContext *out, int *entries, HintSampleQueue *queue) |
static int | write_hint_packets (ByteIOContext *out, const uint8_t *data, int size, MOVTrack *trk, int64_t *pts) |
Write an RTP hint (that may contain one or more RTP packets) for the packets in data. | |
int | ff_mov_add_hinted_packet (AVFormatContext *s, AVPacket *pkt, int track_index, int sample) |
void | ff_mov_close_hinting (MOVTrack *track) |
static void describe_payload | ( | const uint8_t * | data, | |
int | size, | |||
ByteIOContext * | out, | |||
int * | entries, | |||
HintSampleQueue * | queue | |||
) | [static] |
int ff_mov_add_hinted_packet | ( | AVFormatContext * | s, | |
AVPacket * | pkt, | |||
int | track_index, | |||
int | sample | |||
) |
void ff_mov_close_hinting | ( | MOVTrack * | track | ) |
int ff_mov_init_hinting | ( | AVFormatContext * | s, | |
int | index, | |||
int | src_index | |||
) |
static int find_sample_match | ( | const uint8_t * | data, | |
int | len, | |||
HintSampleQueue * | queue, | |||
int * | pos, | |||
int * | match_sample, | |||
int * | match_offset, | |||
int * | match_len | |||
) | [static] |
Look for segments in samples in the sample queue matching the data in ptr.
Samples not matching are removed from the queue. If a match is found, the next time it will look for matches starting from the end of the previous matched segment.
data | data to find matches for in the sample queue | |
len | length of the data buffer | |
queue | samples used for looking for matching segments | |
pos | the offset in data of the matched segment | |
match_sample | the number of the sample that contained the match | |
match_offset | the offset of the matched segment within the sample | |
match_len | the length of the matched segment |
Definition at line 248 of file movenchint.c.
Referenced by describe_payload().
static int match_segments | ( | const uint8_t * | haystack, | |
int | h_len, | |||
const uint8_t * | needle, | |||
int | n_pos, | |||
int | n_len, | |||
int * | match_h_offset_ptr, | |||
int * | match_n_offset_ptr, | |||
int * | match_len_ptr | |||
) | [static] |
Find matches of needle[n_pos ->] within haystack.
If a sufficiently large match is found, matching bytes before n_pos are included in the match, too (within the limits of the arrays).
haystack | buffer that may contain parts of needle | |
h_len | length of the haystack buffer | |
needle | buffer containing source data that have been used to construct haystack | |
n_pos | start position in needle used for looking for matches | |
n_len | length of the needle buffer | |
match_h_offset_ptr | offset of the first matching byte within haystack | |
match_n_offset_ptr | offset of the first matching byte within needle | |
match_len_ptr | length of the matched segment |
Definition at line 196 of file movenchint.c.
Referenced by find_sample_match().
static void output_immediate | ( | const uint8_t * | data, | |
int | size, | |||
ByteIOContext * | out, | |||
int * | entries | |||
) | [static] |
static void output_match | ( | ByteIOContext * | out, | |
int | match_sample, | |||
int | match_offset, | |||
int | match_len, | |||
int * | entries | |||
) | [static] |
static void sample_queue_free | ( | HintSampleQueue * | queue | ) | [static] |
Empty the sample queue, releasing all memory.
Definition at line 117 of file movenchint.c.
Referenced by ff_mov_close_hinting().
static void sample_queue_pop | ( | HintSampleQueue * | queue | ) | [static] |
Remove the first sample from the sample queue.
Definition at line 104 of file movenchint.c.
Referenced by find_sample_match().
static void sample_queue_push | ( | HintSampleQueue * | queue, | |
AVPacket * | pkt, | |||
int | sample | |||
) | [static] |
Add a reference to the sample data to the sample queue.
The data is not copied. sample_queue_retain should be called before pkt->data is reused/freed.
Definition at line 133 of file movenchint.c.
Referenced by ff_mov_add_hinted_packet().
static void sample_queue_retain | ( | HintSampleQueue * | queue | ) | [static] |
Make local copies of all referenced sample data in the queue.
Definition at line 158 of file movenchint.c.
Referenced by ff_mov_add_hinted_packet().
static int write_hint_packets | ( | ByteIOContext * | out, | |
const uint8_t * | data, | |||
int | size, | |||
MOVTrack * | trk, | |||
int64_t * | pts | |||
) | [static] |
Write an RTP hint (that may contain one or more RTP packets) for the packets in data.
data contains one or more packets with a BE32 size header.
out | buffer where the hints are written | |
data | buffer containing RTP packets | |
size | the size of the data buffer | |
trk | the MOVTrack for the hint track | |
pts | pointer where the timestamp for the written RTP hint is stored |
Definition at line 348 of file movenchint.c.
Referenced by ff_mov_add_hinted_packet().