OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // A test program that drives an OpenMAX video decoder module. This program | 5 // A test program that drives an OpenMAX video decoder module. This program |
6 // will take video in elementary stream and read into the decoder. | 6 // will take video in elementary stream and read into the decoder. |
7 // | 7 // |
8 // Run the following command to see usage: | 8 // Run the following command to see usage: |
9 // ./omx_test | 9 // ./omx_test |
10 | 10 |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 | 267 |
268 // TODO(wjia): add more configurations needed by encoder | 268 // TODO(wjia): add more configurations needed by encoder |
269 return true; | 269 return true; |
270 } | 270 } |
271 | 271 |
272 static bool InitFFmpeg() { | 272 static bool InitFFmpeg() { |
273 if (!media::InitializeMediaLibrary(FilePath())) | 273 if (!media::InitializeMediaLibrary(FilePath())) |
274 return false; | 274 return false; |
275 avcodec_init(); | 275 avcodec_init(); |
276 av_register_all(); | 276 av_register_all(); |
277 av_register_protocol(&kFFmpegFileProtocol); | 277 av_register_protocol2(&kFFmpegFileProtocol, sizeof(kFFmpegFileProtocol)); |
278 return true; | 278 return true; |
279 } | 279 } |
280 | 280 |
281 static void PrintHelp() { | 281 static void PrintHelp() { |
282 printf("Using for decoding...\n"); | 282 printf("Using for decoding...\n"); |
283 printf("\n"); | 283 printf("\n"); |
284 printf("Usage: omx_test --input-file=FILE --codec=CODEC" | 284 printf("Usage: omx_test --input-file=FILE --codec=CODEC" |
285 " [--output-file=FILE] [--enable-csc]" | 285 " [--output-file=FILE] [--enable-csc]" |
286 " [--copy] [--use-ffmpeg]\n"); | 286 " [--copy] [--use-ffmpeg]\n"); |
287 printf(" CODEC: h264/mpeg4/h263/vc1\n"); | 287 printf(" CODEC: h264/mpeg4/h263/vc1\n"); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 if (!test->Initialize()) { | 383 if (!test->Initialize()) { |
384 LOG(ERROR) << "can't initialize this application"; | 384 LOG(ERROR) << "can't initialize this application"; |
385 return -1; | 385 return -1; |
386 } | 386 } |
387 | 387 |
388 // This will run the decoder until EOS is reached or an error | 388 // This will run the decoder until EOS is reached or an error |
389 // is encountered. | 389 // is encountered. |
390 test->Run(); | 390 test->Run(); |
391 return 0; | 391 return 0; |
392 } | 392 } |
OLD | NEW |