| 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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 | 266 |
| 267 // TODO(wjia): add more configurations needed by encoder | 267 // TODO(wjia): add more configurations needed by encoder |
| 268 return true; | 268 return true; |
| 269 } | 269 } |
| 270 | 270 |
| 271 static bool InitFFmpeg() { | 271 static bool InitFFmpeg() { |
| 272 if (!media::InitializeMediaLibrary(FilePath())) | 272 if (!media::InitializeMediaLibrary(FilePath())) |
| 273 return false; | 273 return false; |
| 274 avcodec_init(); | 274 avcodec_init(); |
| 275 av_register_all(); | 275 av_register_all(); |
| 276 av_register_protocol2(&kFFmpegFileProtocol, sizeof(kFFmpegFileProtocol)); | 276 av_register_protocol(&kFFmpegFileProtocol); |
| 277 return true; | 277 return true; |
| 278 } | 278 } |
| 279 | 279 |
| 280 static void PrintHelp() { | 280 static void PrintHelp() { |
| 281 printf("Using for decoding...\n"); | 281 printf("Using for decoding...\n"); |
| 282 printf("\n"); | 282 printf("\n"); |
| 283 printf("Usage: omx_test --input-file=FILE --codec=CODEC" | 283 printf("Usage: omx_test --input-file=FILE --codec=CODEC" |
| 284 " [--output-file=FILE] [--enable-csc]" | 284 " [--output-file=FILE] [--enable-csc]" |
| 285 " [--copy] [--use-ffmpeg]\n"); | 285 " [--copy] [--use-ffmpeg]\n"); |
| 286 printf(" CODEC: h264/mpeg4/h263/vc1\n"); | 286 printf(" CODEC: h264/mpeg4/h263/vc1\n"); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 if (!test->Initialize()) { | 382 if (!test->Initialize()) { |
| 383 LOG(ERROR) << "can't initialize this application"; | 383 LOG(ERROR) << "can't initialize this application"; |
| 384 return -1; | 384 return -1; |
| 385 } | 385 } |
| 386 | 386 |
| 387 // This will run the decoder until EOS is reached or an error | 387 // This will run the decoder until EOS is reached or an error |
| 388 // is encountered. | 388 // is encountered. |
| 389 test->Run(); | 389 test->Run(); |
| 390 return 0; | 390 return 0; |
| 391 } | 391 } |
| OLD | NEW |