| 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 } | 166 } |
| 167 | 167 |
| 168 void Run() { | 168 void Run() { |
| 169 StartProfiler(); | 169 StartProfiler(); |
| 170 | 170 |
| 171 // Setup the |engine_| with the message loop of the current thread. Also | 171 // Setup the |engine_| with the message loop of the current thread. Also |
| 172 // setup codec format and callbacks. | 172 // setup codec format and callbacks. |
| 173 media::VideoCodecConfig config; | 173 media::VideoCodecConfig config; |
| 174 switch (av_stream_->codec->codec_id) { | 174 switch (av_stream_->codec->codec_id) { |
| 175 case CODEC_ID_VC1: | 175 case CODEC_ID_VC1: |
| 176 config.codec_ = media::kCodecVC1; break; | 176 config.codec = media::kCodecVC1; break; |
| 177 case CODEC_ID_H264: | 177 case CODEC_ID_H264: |
| 178 config.codec_ = media::kCodecH264; break; | 178 config.codec = media::kCodecH264; break; |
| 179 case CODEC_ID_THEORA: | 179 case CODEC_ID_THEORA: |
| 180 config.codec_ = media::kCodecTheora; break; | 180 config.codec = media::kCodecTheora; break; |
| 181 case CODEC_ID_MPEG2VIDEO: | 181 case CODEC_ID_MPEG2VIDEO: |
| 182 config.codec_ = media::kCodecMPEG2; break; | 182 config.codec = media::kCodecMPEG2; break; |
| 183 case CODEC_ID_MPEG4: | 183 case CODEC_ID_MPEG4: |
| 184 config.codec_ = media::kCodecMPEG4; break; | 184 config.codec = media::kCodecMPEG4; break; |
| 185 default: | 185 default: |
| 186 NOTREACHED(); break; | 186 NOTREACHED(); break; |
| 187 } | 187 } |
| 188 config.opaque_context_ = NULL; | 188 config.opaque_context = NULL; |
| 189 config.width_ = av_stream_->codec->width; | 189 config.width = av_stream_->codec->width; |
| 190 config.height_ = av_stream_->codec->height; | 190 config.height = av_stream_->codec->height; |
| 191 engine_.reset(new OmxVideoDecodeEngine()); | 191 engine_.reset(new OmxVideoDecodeEngine()); |
| 192 engine_->Initialize(&message_loop_, this, config); | 192 engine_->Initialize(&message_loop_, this, config); |
| 193 | 193 |
| 194 // Execute the message loop so that we can run tasks on it. This call | 194 // Execute the message loop so that we can run tasks on it. This call |
| 195 // will return when we call message_loop_.Quit(). | 195 // will return when we call message_loop_.Quit(). |
| 196 message_loop_.Run(); | 196 message_loop_.Run(); |
| 197 | 197 |
| 198 StopProfiler(); | 198 StopProfiler(); |
| 199 } | 199 } |
| 200 | 200 |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 if (!test->Initialize()) { | 412 if (!test->Initialize()) { |
| 413 LOG(ERROR) << "can't initialize this application"; | 413 LOG(ERROR) << "can't initialize this application"; |
| 414 return -1; | 414 return -1; |
| 415 } | 415 } |
| 416 | 416 |
| 417 // This will run the decoder until EOS is reached or an error | 417 // This will run the decoder until EOS is reached or an error |
| 418 // is encountered. | 418 // is encountered. |
| 419 test->Run(); | 419 test->Run(); |
| 420 return 0; | 420 return 0; |
| 421 } | 421 } |
| OLD | NEW |