summaryrefslogtreecommitdiffstats
path: root/media/omx/omx_codec.h
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-21 02:05:37 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-21 02:05:37 +0000
commit2f465753368c58befe94e801179f8d7a31640901 (patch)
tree0d3dc9c37afe838c64bf892f76078c5b40b61cf9 /media/omx/omx_codec.h
parent8c0af3834e11d643562c13788c06c695f2666f51 (diff)
downloadchromium_src-2f465753368c58befe94e801179f8d7a31640901.zip
chromium_src-2f465753368c58befe94e801179f8d7a31640901.tar.gz
chromium_src-2f465753368c58befe94e801179f8d7a31640901.tar.bz2
Video and OpenMAX: add role name to replace vendor specific component name.
Add role name to replace vendor specific component name. Remove vendor specific Open MAX component name. use role name to find the appropriate component name in current OMX core library. We only pick the first component name returned and ignore all the other components with the same role. BUG=none TEST=none Reviewed: http://codereview.chromium.org/551084/show Submitted for: jiesun@chromium.org Review URL: http://codereview.chromium.org/546098 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36716 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/omx/omx_codec.h')
-rw-r--r--media/omx/omx_codec.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/media/omx/omx_codec.h b/media/omx/omx_codec.h
index c198766..bb98a3d 100644
--- a/media/omx/omx_codec.h
+++ b/media/omx/omx_codec.h
@@ -18,7 +18,7 @@
// OmxCodec::OmxMediaFormat input_format, output_format;
// input_format.codec = OmxCodec::kCodecH264;
// output_format.codec = OmxCodec::kCodecRaw;
-// decoder->Setup(component_name, input_format, output_format);
+// decoder->Setup(input_format, output_format);
// decoder->SetErrorCallback(NewCallback(this, &Client::ErrorCallback));
// decoder->SetFormatCallback(NewCallback(this, &Client::FormatCallback));
//
@@ -174,8 +174,7 @@ class OmxCodec : public base::RefCountedThreadSafe<OmxCodec> {
// Set the component name and input/output media format.
// TODO(hclam): Remove |component|.
- void Setup(const std::string& component_name,
- const OmxMediaFormat& input_format,
+ void Setup(const OmxMediaFormat& input_format,
const OmxMediaFormat& output_format);
// Set the error callback. In case of error the callback will be called.
@@ -264,6 +263,9 @@ class OmxCodec : public base::RefCountedThreadSafe<OmxCodec> {
bool ConfigureAsEncoder(OMX_PARAM_PORTDEFINITIONTYPE* input_port_def,
OMX_PARAM_PORTDEFINITIONTYPE* output_port_def);
+ // Helper to return predefined OpenMAX role name for specific codec type.
+ static std::string SelectRole(Codec codec, bool encoder);
+
// Methods and free input and output buffers.
bool AllocateInputBuffers();
bool AllocateOutputBuffers();
@@ -375,6 +377,7 @@ class OmxCodec : public base::RefCountedThreadSafe<OmxCodec> {
State next_state_;
// TODO(hclam): We should keep a list of component names.
+ std::string role_name_;
std::string component_name_;
OMX_COMPONENTTYPE* component_handle_;
bool encoder_;