• Home
  • Raw
  • Download

Lines Matching refs:webm_ctx

23 void reset(struct WebmInputContext *const webm_ctx) {  in reset()  argument
24 if (webm_ctx->reader != NULL) { in reset()
26 reinterpret_cast<mkvparser::MkvReader *>(webm_ctx->reader); in reset()
29 if (webm_ctx->segment != NULL) { in reset()
31 reinterpret_cast<mkvparser::Segment *>(webm_ctx->segment); in reset()
34 if (webm_ctx->buffer != NULL) { in reset()
35 delete[] webm_ctx->buffer; in reset()
37 webm_ctx->reader = NULL; in reset()
38 webm_ctx->segment = NULL; in reset()
39 webm_ctx->buffer = NULL; in reset()
40 webm_ctx->cluster = NULL; in reset()
41 webm_ctx->block_entry = NULL; in reset()
42 webm_ctx->block = NULL; in reset()
43 webm_ctx->block_frame_index = 0; in reset()
44 webm_ctx->video_track_index = 0; in reset()
45 webm_ctx->timestamp_ns = 0; in reset()
46 webm_ctx->is_key_frame = false; in reset()
49 void get_first_cluster(struct WebmInputContext *const webm_ctx) { in get_first_cluster() argument
51 reinterpret_cast<mkvparser::Segment *>(webm_ctx->segment); in get_first_cluster()
53 webm_ctx->cluster = cluster; in get_first_cluster()
56 void rewind_and_reset(struct WebmInputContext *const webm_ctx, in rewind_and_reset() argument
59 reset(webm_ctx); in rewind_and_reset()
64 int file_is_webm(struct WebmInputContext *webm_ctx, in file_is_webm() argument
67 webm_ctx->reader = reader; in file_is_webm()
68 webm_ctx->reached_eos = 0; in file_is_webm()
73 rewind_and_reset(webm_ctx, aom_ctx); in file_is_webm()
79 rewind_and_reset(webm_ctx, aom_ctx); in file_is_webm()
82 webm_ctx->segment = segment; in file_is_webm()
84 rewind_and_reset(webm_ctx, aom_ctx); in file_is_webm()
94 webm_ctx->video_track_index = static_cast<int>(track->GetNumber()); in file_is_webm()
100 rewind_and_reset(webm_ctx, aom_ctx); in file_is_webm()
107 rewind_and_reset(webm_ctx, aom_ctx); in file_is_webm()
116 get_first_cluster(webm_ctx); in file_is_webm()
121 int webm_read_frame(struct WebmInputContext *webm_ctx, uint8_t **buffer, in webm_read_frame() argument
123 assert(webm_ctx->buffer == *buffer); in webm_read_frame()
126 if (webm_ctx->reached_eos) { in webm_read_frame()
130 reinterpret_cast<mkvparser::Segment *>(webm_ctx->segment); in webm_read_frame()
132 reinterpret_cast<const mkvparser::Cluster *>(webm_ctx->cluster); in webm_read_frame()
134 reinterpret_cast<const mkvparser::Block *>(webm_ctx->block); in webm_read_frame()
136 reinterpret_cast<const mkvparser::BlockEntry *>(webm_ctx->block_entry); in webm_read_frame()
148 webm_ctx->reached_eos = 1; in webm_read_frame()
155 webm_ctx->block_frame_index == block->GetFrameCount() || in webm_read_frame()
156 block->GetTrackNumber() != webm_ctx->video_track_index) { in webm_read_frame()
170 webm_ctx->block_frame_index = 0; in webm_read_frame()
173 block->GetTrackNumber() != webm_ctx->video_track_index); in webm_read_frame()
175 webm_ctx->cluster = cluster; in webm_read_frame()
176 webm_ctx->block_entry = block_entry; in webm_read_frame()
177 webm_ctx->block = block; in webm_read_frame()
180 block->GetFrame(webm_ctx->block_frame_index); in webm_read_frame()
181 ++webm_ctx->block_frame_index; in webm_read_frame()
185 webm_ctx->buffer = *buffer; in webm_read_frame()
192 webm_ctx->timestamp_ns = block->GetTime(cluster); in webm_read_frame()
193 webm_ctx->is_key_frame = block->IsKey(); in webm_read_frame()
196 reinterpret_cast<mkvparser::MkvReader *>(webm_ctx->reader); in webm_read_frame()
211 int webm_guess_framerate(struct WebmInputContext *webm_ctx, in webm_guess_framerate() argument
217 assert(webm_ctx->buffer == NULL); in webm_guess_framerate()
218 while (webm_ctx->timestamp_ns < 1000000000 && i < 50) { in webm_guess_framerate()
219 if (webm_read_frame(webm_ctx, &buffer, &bytes_read, &buffer_size)) { in webm_guess_framerate()
226 static_cast<int>(webm_ctx->timestamp_ns / 1000); in webm_guess_framerate()
236 webm_ctx->buffer = NULL; in webm_guess_framerate()
238 get_first_cluster(webm_ctx); in webm_guess_framerate()
239 webm_ctx->block = NULL; in webm_guess_framerate()
240 webm_ctx->block_entry = NULL; in webm_guess_framerate()
241 webm_ctx->block_frame_index = 0; in webm_guess_framerate()
242 webm_ctx->timestamp_ns = 0; in webm_guess_framerate()
243 webm_ctx->reached_eos = 0; in webm_guess_framerate()
248 void webm_free(struct WebmInputContext *webm_ctx) { reset(webm_ctx); } in webm_free() argument