OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. Use of this |
2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
3 // LICENSE file. | 3 // LICENSE file. |
4 | 4 |
5 #include "media/omx/omx_configurator.h" | 5 #include "media/omx/omx_configurator.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 namespace { | 9 namespace media { |
10 | 10 |
11 std::string GetCodecName(media::OmxConfigurator::Codec codec) { | 11 static std::string GetCodecName(OmxConfigurator::Codec codec) { |
12 switch (codec) { | 12 switch (codec) { |
13 case media::OmxConfigurator::kCodecH264: | 13 case OmxConfigurator::kCodecH264: |
14 return "avc"; | 14 return "avc"; |
15 case media::OmxConfigurator::kCodecH263: | 15 case OmxConfigurator::kCodecH263: |
16 return "h263"; | 16 return "h263"; |
17 case media::OmxConfigurator::kCodecMpeg4: | 17 case OmxConfigurator::kCodecMpeg4: |
18 return "mpeg4"; | 18 return "mpeg4"; |
19 case media::OmxConfigurator::kCodecVc1: | 19 case OmxConfigurator::kCodecVc1: |
20 return "vc1"; | 20 return "vc1"; |
21 default: | 21 default: |
22 break; | 22 break; |
23 } | 23 } |
24 NOTREACHED(); | 24 NOTREACHED(); |
25 return ""; | 25 return ""; |
26 } | 26 } |
27 | 27 |
28 } // namespace | |
29 | |
30 namespace media { | |
31 | |
32 std::string OmxDecoderConfigurator::GetRoleName() const { | 28 std::string OmxDecoderConfigurator::GetRoleName() const { |
33 return "video_decoder." + GetCodecName(input_format().codec); | 29 return "video_decoder." + GetCodecName(input_format().codec); |
34 } | 30 } |
35 | 31 |
36 bool OmxDecoderConfigurator::ConfigureIOPorts( | 32 bool OmxDecoderConfigurator::ConfigureIOPorts( |
37 OMX_COMPONENTTYPE* component, | 33 OMX_COMPONENTTYPE* component, |
38 OMX_PARAM_PORTDEFINITIONTYPE* input_port_def, | 34 OMX_PARAM_PORTDEFINITIONTYPE* input_port_def, |
39 OMX_PARAM_PORTDEFINITIONTYPE* output_port_def) const { | 35 OMX_PARAM_PORTDEFINITIONTYPE* output_port_def) const { |
40 // Configure the input port. | 36 // Configure the input port. |
41 if (input_format().codec == kCodecNone) { | 37 if (input_format().codec == kCodecNone) { |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 OMX_IndexConfigVideoFramerate, | 159 OMX_IndexConfigVideoFramerate, |
164 &framerate); | 160 &framerate); |
165 if (omxresult != OMX_ErrorNone) { | 161 if (omxresult != OMX_ErrorNone) { |
166 LOG(ERROR) << "SetParameter(OMX_IndexConfigVideoFramerate) failed"; | 162 LOG(ERROR) << "SetParameter(OMX_IndexConfigVideoFramerate) failed"; |
167 return false; | 163 return false; |
168 } | 164 } |
169 return true; | 165 return true; |
170 } | 166 } |
171 | 167 |
172 } // namespace media | 168 } // namespace media |
OLD | NEW |