Commit f1f3d092 authored by Deb Mukherjee's avatar Deb Mukherjee Committed by Gerrit Code Review

Merge "Renames interface field in VpxInterface"

parents 998cff61 f332c630
...@@ -104,9 +104,9 @@ int main(int argc, char **argv) { ...@@ -104,9 +104,9 @@ int main(int argc, char **argv) {
if (!decoder) if (!decoder)
die("Unknown input codec."); die("Unknown input codec.");
printf("Using %s\n", vpx_codec_iface_name(decoder->interface())); printf("Using %s\n", vpx_codec_iface_name(decoder->codec_interface()));
if (vpx_codec_dec_init(&codec, decoder->interface(), NULL, 0)) if (vpx_codec_dec_init(&codec, decoder->codec_interface(), NULL, 0))
die_codec(&codec, "Failed to initialize decoder"); die_codec(&codec, "Failed to initialize decoder");
while (vpx_video_reader_read_frame(reader)) { while (vpx_video_reader_read_frame(reader)) {
......
...@@ -108,9 +108,9 @@ int main(int argc, char **argv) { ...@@ -108,9 +108,9 @@ int main(int argc, char **argv) {
if (!decoder) if (!decoder)
die("Unknown input codec."); die("Unknown input codec.");
printf("Using %s\n", vpx_codec_iface_name(decoder->interface())); printf("Using %s\n", vpx_codec_iface_name(decoder->codec_interface()));
if (vpx_codec_dec_init(&codec, decoder->interface(), NULL, 0)) if (vpx_codec_dec_init(&codec, decoder->codec_interface(), NULL, 0))
die_codec(&codec, "Failed to initialize decoder."); die_codec(&codec, "Failed to initialize decoder.");
while (vpx_video_reader_read_frame(reader)) { while (vpx_video_reader_read_frame(reader)) {
......
...@@ -86,9 +86,9 @@ int main(int argc, char **argv) { ...@@ -86,9 +86,9 @@ int main(int argc, char **argv) {
if (!decoder) if (!decoder)
die("Unknown input codec."); die("Unknown input codec.");
printf("Using %s\n", vpx_codec_iface_name(decoder->interface())); printf("Using %s\n", vpx_codec_iface_name(decoder->codec_interface()));
res = vpx_codec_dec_init(&codec, decoder->interface(), NULL, res = vpx_codec_dec_init(&codec, decoder->codec_interface(), NULL,
VPX_CODEC_USE_POSTPROC); VPX_CODEC_USE_POSTPROC);
if (res == VPX_CODEC_INCAPABLE) if (res == VPX_CODEC_INCAPABLE)
die_codec(&codec, "Postproc not supported by this decoder."); die_codec(&codec, "Postproc not supported by this decoder.");
......
...@@ -193,9 +193,9 @@ int main(int argc, char **argv) { ...@@ -193,9 +193,9 @@ int main(int argc, char **argv) {
die("Failed to allocate image."); die("Failed to allocate image.");
} }
printf("Using %s\n", vpx_codec_iface_name(encoder->interface())); printf("Using %s\n", vpx_codec_iface_name(encoder->codec_interface()));
res = vpx_codec_enc_config_default(encoder->interface(), &cfg, 0); res = vpx_codec_enc_config_default(encoder->codec_interface(), &cfg, 0);
if (res) if (res)
die_codec(&codec, "Failed to get default codec config."); die_codec(&codec, "Failed to get default codec config.");
...@@ -214,7 +214,7 @@ int main(int argc, char **argv) { ...@@ -214,7 +214,7 @@ int main(int argc, char **argv) {
if (!(infile = fopen(argv[4], "rb"))) if (!(infile = fopen(argv[4], "rb")))
die("Failed to open %s for reading.", argv[4]); die("Failed to open %s for reading.", argv[4]);
if (vpx_codec_enc_init(&codec, encoder->interface(), &cfg, 0)) if (vpx_codec_enc_init(&codec, encoder->codec_interface(), &cfg, 0))
die_codec(&codec, "Failed to initialize encoder"); die_codec(&codec, "Failed to initialize encoder");
while (vpx_img_read(&raw, infile)) { while (vpx_img_read(&raw, infile)) {
......
...@@ -123,9 +123,9 @@ int main(int argc, char **argv) { ...@@ -123,9 +123,9 @@ int main(int argc, char **argv) {
if (!decoder) if (!decoder)
die("Unknown input codec."); die("Unknown input codec.");
printf("Using %s\n", vpx_codec_iface_name(decoder->interface())); printf("Using %s\n", vpx_codec_iface_name(decoder->codec_interface()));
if (vpx_codec_dec_init(&codec, decoder->interface(), NULL, 0)) if (vpx_codec_dec_init(&codec, decoder->codec_interface(), NULL, 0))
die_codec(&codec, "Failed to initialize decoder."); die_codec(&codec, "Failed to initialize decoder.");
while (vpx_video_reader_read_frame(reader)) { while (vpx_video_reader_read_frame(reader)) {
......
...@@ -207,9 +207,9 @@ int main(int argc, char **argv) { ...@@ -207,9 +207,9 @@ int main(int argc, char **argv) {
if (keyframe_interval < 0) if (keyframe_interval < 0)
die("Invalid keyframe interval value."); die("Invalid keyframe interval value.");
printf("Using %s\n", vpx_codec_iface_name(encoder->interface())); printf("Using %s\n", vpx_codec_iface_name(encoder->codec_interface()));
res = vpx_codec_enc_config_default(encoder->interface(), &cfg, 0); res = vpx_codec_enc_config_default(encoder->codec_interface(), &cfg, 0);
if (res) if (res)
die_codec(&codec, "Failed to get default codec config."); die_codec(&codec, "Failed to get default codec config.");
...@@ -227,7 +227,7 @@ int main(int argc, char **argv) { ...@@ -227,7 +227,7 @@ int main(int argc, char **argv) {
if (!(infile = fopen(infile_arg, "rb"))) if (!(infile = fopen(infile_arg, "rb")))
die("Failed to open %s for reading.", infile_arg); die("Failed to open %s for reading.", infile_arg);
if (vpx_codec_enc_init(&codec, encoder->interface(), &cfg, 0)) if (vpx_codec_enc_init(&codec, encoder->codec_interface(), &cfg, 0))
die_codec(&codec, "Failed to initialize encoder"); die_codec(&codec, "Failed to initialize encoder");
while (vpx_img_read(&raw, infile)) { while (vpx_img_read(&raw, infile)) {
......
...@@ -168,9 +168,9 @@ int main(int argc, char **argv) { ...@@ -168,9 +168,9 @@ int main(int argc, char **argv) {
if (!writer) if (!writer)
die("Failed to open %s for writing", outfile_arg); die("Failed to open %s for writing", outfile_arg);
printf("Using %s\n", vpx_codec_iface_name(encoder->interface())); printf("Using %s\n", vpx_codec_iface_name(encoder->codec_interface()));
res = vpx_codec_enc_config_default(encoder->interface(), &cfg, 0); res = vpx_codec_enc_config_default(encoder->codec_interface(), &cfg, 0);
if (res) if (res)
die_codec(&codec, "Failed to get default codec config."); die_codec(&codec, "Failed to get default codec config.");
...@@ -193,7 +193,7 @@ int main(int argc, char **argv) { ...@@ -193,7 +193,7 @@ int main(int argc, char **argv) {
if (!(infile = fopen(infile_arg, "rb"))) if (!(infile = fopen(infile_arg, "rb")))
die("Failed to open %s for reading", infile_arg); die("Failed to open %s for reading", infile_arg);
if (vpx_codec_enc_init(&codec, encoder->interface(), &cfg, 0)) if (vpx_codec_enc_init(&codec, encoder->codec_interface(), &cfg, 0))
die_codec(&codec, "Failed to initialize encoder"); die_codec(&codec, "Failed to initialize encoder");
while (vpx_img_read(&raw, infile)) { while (vpx_img_read(&raw, infile)) {
......
...@@ -138,9 +138,9 @@ int main(int argc, char **argv) { ...@@ -138,9 +138,9 @@ int main(int argc, char **argv) {
die("Failed to allocate image."); die("Failed to allocate image.");
} }
printf("Using %s\n", vpx_codec_iface_name(encoder->interface())); printf("Using %s\n", vpx_codec_iface_name(encoder->codec_interface()));
res = vpx_codec_enc_config_default(encoder->interface(), &cfg, 0); res = vpx_codec_enc_config_default(encoder->codec_interface(), &cfg, 0);
if (res) if (res)
die_codec(&codec, "Failed to get default codec config."); die_codec(&codec, "Failed to get default codec config.");
...@@ -157,7 +157,7 @@ int main(int argc, char **argv) { ...@@ -157,7 +157,7 @@ int main(int argc, char **argv) {
if (!(infile = fopen(argv[3], "rb"))) if (!(infile = fopen(argv[3], "rb")))
die("Failed to open %s for reading.", argv[3]); die("Failed to open %s for reading.", argv[3]);
if (vpx_codec_enc_init(&codec, encoder->interface(), &cfg, 0)) if (vpx_codec_enc_init(&codec, encoder->codec_interface(), &cfg, 0))
die_codec(&codec, "Failed to initialize encoder"); die_codec(&codec, "Failed to initialize encoder");
while (vpx_img_read(&raw, infile)) { while (vpx_img_read(&raw, infile)) {
......
...@@ -474,7 +474,7 @@ int main(int argc, char **argv) { ...@@ -474,7 +474,7 @@ int main(int argc, char **argv) {
if (!encoder) if (!encoder)
die("Unsupported codec."); die("Unsupported codec.");
printf("Using %s\n", vpx_codec_iface_name(encoder->interface())); printf("Using %s\n", vpx_codec_iface_name(encoder->codec_interface()));
width = strtol(argv[4], NULL, 0); width = strtol(argv[4], NULL, 0);
height = strtol(argv[5], NULL, 0); height = strtol(argv[5], NULL, 0);
...@@ -496,7 +496,7 @@ int main(int argc, char **argv) { ...@@ -496,7 +496,7 @@ int main(int argc, char **argv) {
} }
// Populate encoder configuration. // Populate encoder configuration.
res = vpx_codec_enc_config_default(encoder->interface(), &cfg, 0); res = vpx_codec_enc_config_default(encoder->codec_interface(), &cfg, 0);
if (res) { if (res) {
printf("Failed to get config: %s\n", vpx_codec_err_to_string(res)); printf("Failed to get config: %s\n", vpx_codec_err_to_string(res));
return EXIT_FAILURE; return EXIT_FAILURE;
...@@ -574,7 +574,7 @@ int main(int argc, char **argv) { ...@@ -574,7 +574,7 @@ int main(int argc, char **argv) {
cfg.ss_number_layers = 1; cfg.ss_number_layers = 1;
// Initialize codec. // Initialize codec.
if (vpx_codec_enc_init(&codec, encoder->interface(), &cfg, 0)) if (vpx_codec_enc_init(&codec, encoder->codec_interface(), &cfg, 0))
die_codec(&codec, "Failed to initialize encoder"); die_codec(&codec, "Failed to initialize encoder");
if (strncmp(encoder->name, "vp8", 3) == 0) { if (strncmp(encoder->name, "vp8", 3) == 0) {
......
...@@ -120,7 +120,7 @@ int read_yuv_frame(struct VpxInputContext *input_ctx, vpx_image_t *yuv_frame); ...@@ -120,7 +120,7 @@ int read_yuv_frame(struct VpxInputContext *input_ctx, vpx_image_t *yuv_frame);
typedef struct VpxInterface { typedef struct VpxInterface {
const char *const name; const char *const name;
const uint32_t fourcc; const uint32_t fourcc;
vpx_codec_iface_t *(*const interface)(); vpx_codec_iface_t *(*const codec_interface)();
} VpxInterface; } VpxInterface;
int get_vpx_encoder_count(); int get_vpx_encoder_count();
......
...@@ -166,7 +166,7 @@ void usage_exit() { ...@@ -166,7 +166,7 @@ void usage_exit() {
for (i = 0; i < get_vpx_decoder_count(); ++i) { for (i = 0; i < get_vpx_decoder_count(); ++i) {
const VpxInterface *const decoder = get_vpx_decoder_by_index(i); const VpxInterface *const decoder = get_vpx_decoder_by_index(i);
fprintf(stderr, " %-6s - %s\n", fprintf(stderr, " %-6s - %s\n",
decoder->name, vpx_codec_iface_name(decoder->interface())); decoder->name, vpx_codec_iface_name(decoder->codec_interface()));
} }
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
...@@ -286,7 +286,7 @@ int file_is_raw(struct VpxInputContext *input) { ...@@ -286,7 +286,7 @@ int file_is_raw(struct VpxInputContext *input) {
if (mem_get_le32(buf) < 256 * 1024 * 1024) { if (mem_get_le32(buf) < 256 * 1024 * 1024) {
for (i = 0; i < get_vpx_decoder_count(); ++i) { for (i = 0; i < get_vpx_decoder_count(); ++i) {
const VpxInterface *const decoder = get_vpx_decoder_by_index(i); const VpxInterface *const decoder = get_vpx_decoder_by_index(i);
if (!vpx_codec_peek_stream_info(decoder->interface(), if (!vpx_codec_peek_stream_info(decoder->codec_interface(),
buf + 4, 32 - 4, &si)) { buf + 4, 32 - 4, &si)) {
is_raw = 1; is_raw = 1;
input->fourcc = decoder->fourcc; input->fourcc = decoder->fourcc;
...@@ -728,7 +728,8 @@ int main_loop(int argc, const char **argv_) { ...@@ -728,7 +728,8 @@ int main_loop(int argc, const char **argv_) {
dec_flags = (postproc ? VPX_CODEC_USE_POSTPROC : 0) | dec_flags = (postproc ? VPX_CODEC_USE_POSTPROC : 0) |
(ec_enabled ? VPX_CODEC_USE_ERROR_CONCEALMENT : 0); (ec_enabled ? VPX_CODEC_USE_ERROR_CONCEALMENT : 0);
if (vpx_codec_dec_init(&decoder, interface->interface(), &cfg, dec_flags)) { if (vpx_codec_dec_init(&decoder, interface->codec_interface(),
&cfg, dec_flags)) {
fprintf(stderr, "Failed to initialize decoder: %s\n", fprintf(stderr, "Failed to initialize decoder: %s\n",
vpx_codec_error(&decoder)); vpx_codec_error(&decoder));
return EXIT_FAILURE; return EXIT_FAILURE;
......
...@@ -426,7 +426,7 @@ void usage_exit() { ...@@ -426,7 +426,7 @@ void usage_exit() {
for (i = 0; i < get_vpx_encoder_count(); ++i) { for (i = 0; i < get_vpx_encoder_count(); ++i) {
const VpxInterface *const encoder = get_vpx_encoder_by_index(i); const VpxInterface *const encoder = get_vpx_encoder_by_index(i);
fprintf(stderr, " %-6s - %s\n", fprintf(stderr, " %-6s - %s\n",
encoder->name, vpx_codec_iface_name(encoder->interface())); encoder->name, vpx_codec_iface_name(encoder->codec_interface()));
} }
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
...@@ -798,7 +798,7 @@ static struct stream_state *new_stream(struct VpxEncoderConfig *global, ...@@ -798,7 +798,7 @@ static struct stream_state *new_stream(struct VpxEncoderConfig *global,
vpx_codec_err_t res; vpx_codec_err_t res;
/* Populate encoder configuration */ /* Populate encoder configuration */
res = vpx_codec_enc_config_default(global->codec->interface(), res = vpx_codec_enc_config_default(global->codec->codec_interface(),
&stream->config.cfg, &stream->config.cfg,
global->usage); global->usage);
if (res) if (res)
...@@ -1112,7 +1112,7 @@ static void show_stream_config(struct stream_state *stream, ...@@ -1112,7 +1112,7 @@ static void show_stream_config(struct stream_state *stream,
if (stream->index == 0) { if (stream->index == 0) {
fprintf(stderr, "Codec: %s\n", fprintf(stderr, "Codec: %s\n",
vpx_codec_iface_name(global->codec->interface())); vpx_codec_iface_name(global->codec->codec_interface()));
fprintf(stderr, "Source file: %s File Type: %s Format: %s\n", fprintf(stderr, "Source file: %s File Type: %s Format: %s\n",
input->filename, input->filename,
file_type_to_string(input->file_type), file_type_to_string(input->file_type),
...@@ -1262,7 +1262,7 @@ static void initialize_encoder(struct stream_state *stream, ...@@ -1262,7 +1262,7 @@ static void initialize_encoder(struct stream_state *stream,
flags |= global->out_part ? VPX_CODEC_USE_OUTPUT_PARTITION : 0; flags |= global->out_part ? VPX_CODEC_USE_OUTPUT_PARTITION : 0;
/* Construct Encoder Context */ /* Construct Encoder Context */
vpx_codec_enc_init(&stream->encoder, global->codec->interface(), vpx_codec_enc_init(&stream->encoder, global->codec->codec_interface(),
&stream->config.cfg, flags); &stream->config.cfg, flags);
ctx_exit_on_error(&stream->encoder, "Failed to initialize encoder"); ctx_exit_on_error(&stream->encoder, "Failed to initialize encoder");
...@@ -1283,7 +1283,7 @@ static void initialize_encoder(struct stream_state *stream, ...@@ -1283,7 +1283,7 @@ static void initialize_encoder(struct stream_state *stream,
#if CONFIG_DECODERS #if CONFIG_DECODERS
if (global->test_decode != TEST_DECODE_OFF) { if (global->test_decode != TEST_DECODE_OFF) {
const VpxInterface *decoder = get_vpx_decoder_by_name(global->codec->name); const VpxInterface *decoder = get_vpx_decoder_by_name(global->codec->name);
vpx_codec_dec_init(&stream->decoder, decoder->interface(), NULL, 0); vpx_codec_dec_init(&stream->decoder, decoder->codec_interface(), NULL, 0);
} }
#endif #endif
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment