
Cherry-Picked the following commits: 0defd8f Changed "WebM" to "AOMedia" & "webm" to "aomedia" 54e6676 Replace "VPx" by "AVx" 5082a36 Change "Vpx" to "Avx" 7df44f1 Replace "Vp9" w/ "Av1" 967f722 Remove kVp9CodecId 828f30c Change "Vp8" to "AOM" 030b5ff AUTHORS regenerated 2524cae Add ref-mv experimental flag 016762b Change copyright notice to AOMedia form 81e5526 Replace vp9 w/ av1 9b94565 Add missing files fa8ca9f Change "vp9" to "av1" ec838b7 Convert "vp8" to "aom" 80edfa0 Change "VP9" to "AV1" d1a11fb Change "vp8" to "aom" 7b58251 Point to WebM test data dd1a5c8 Replace "VP8" with "AOM" ff00fc0 Change "VPX" to "AOM" 01dee0b Change "vp10" to "av1" in source code cebe6f0 Convert "vpx" to "aom" 17b0567 rename vp10*.mk to av1_*.mk fe5f8a8 rename files vp10_* to av1_* Change-Id: I6fc3d18eb11fc171e46140c836ad5339cf6c9419
70 lines
2.2 KiB
C
70 lines
2.2 KiB
C
/*
|
|
* Copyright (c) 2013 The WebM project authors. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
#ifndef WEBMDEC_H_
|
|
#define WEBMDEC_H_
|
|
|
|
#include "./tools_common.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
struct AvxInputContext;
|
|
|
|
struct WebmInputContext {
|
|
void *reader;
|
|
void *segment;
|
|
uint8_t *buffer;
|
|
const void *cluster;
|
|
const void *block_entry;
|
|
const void *block;
|
|
int block_frame_index;
|
|
int video_track_index;
|
|
uint64_t timestamp_ns;
|
|
int is_key_frame;
|
|
int reached_eos;
|
|
};
|
|
|
|
// Checks if the input is a WebM file. If so, initializes WebMInputContext so
|
|
// that webm_read_frame can be called to retrieve a video frame.
|
|
// Returns 1 on success and 0 on failure or input is not WebM file.
|
|
// TODO(vigneshv): Refactor this function into two smaller functions specific
|
|
// to their task.
|
|
int file_is_webm(struct WebmInputContext *webm_ctx,
|
|
struct AvxInputContext *aom_ctx);
|
|
|
|
// Reads a WebM Video Frame. Memory for the buffer is created, owned and managed
|
|
// by this function. For the first call, |buffer| should be NULL and
|
|
// |*buffer_size| should be 0. Once all the frames are read and used,
|
|
// webm_free() should be called, otherwise there will be a leak.
|
|
// Parameters:
|
|
// webm_ctx - WebmInputContext object
|
|
// buffer - pointer where the frame data will be filled.
|
|
// buffer_size - pointer to buffer size.
|
|
// Return values:
|
|
// 0 - Success
|
|
// 1 - End of Stream
|
|
// -1 - Error
|
|
int webm_read_frame(struct WebmInputContext *webm_ctx, uint8_t **buffer,
|
|
size_t *buffer_size);
|
|
|
|
// Guesses the frame rate of the input file based on the container timestamps.
|
|
int webm_guess_framerate(struct WebmInputContext *webm_ctx,
|
|
struct AvxInputContext *aom_ctx);
|
|
|
|
// Resets the WebMInputContext.
|
|
void webm_free(struct WebmInputContext *webm_ctx);
|
|
|
|
#ifdef __cplusplus
|
|
} // extern "C"
|
|
#endif
|
|
|
|
#endif // WEBMDEC_H_
|