Merge change I91eb0354 into eclair-mr2

* changes:
  Change OMXCodec::Create to return an sp<MediaSource> instead of an sp<OMXCodec>, this is more general and does not sacrifice any functionality as the remaining OMXCodec APIs are not meant to be public anyway.
This commit is contained in:
Android (Google) Code Review
2009-12-07 09:57:12 -08:00
4 changed files with 6 additions and 6 deletions

View File

@ -38,12 +38,12 @@ int main() {
meta->setInt32(kKeyMaxInputSize, maxInputSize); meta->setInt32(kKeyMaxInputSize, maxInputSize);
} }
sp<OMXCodec> encoder = OMXCodec::Create( sp<MediaSource> encoder = OMXCodec::Create(
client.interface(), client.interface(),
meta, true /* createEncoder */, meta, true /* createEncoder */,
source); source);
sp<OMXCodec> decoder = OMXCodec::Create( sp<MediaSource> decoder = OMXCodec::Create(
client.interface(), client.interface(),
meta, false /* createEncoder */, meta, false /* createEncoder */,
encoder); encoder);

View File

@ -154,7 +154,7 @@ int main(int argc, char **argv) {
sp<MetaData> meta = source->getFormat(); sp<MetaData> meta = source->getFormat();
sp<OMXCodec> decoder = OMXCodec::Create( sp<MediaSource> decoder = OMXCodec::Create(
client.interface(), meta, false /* createEncoder */, source); client.interface(), meta, false /* createEncoder */, source);
int width, height; int width, height;
@ -173,7 +173,7 @@ int main(int argc, char **argv) {
enc_meta->setInt32(kKeyWidth, width); enc_meta->setInt32(kKeyWidth, width);
enc_meta->setInt32(kKeyHeight, height); enc_meta->setInt32(kKeyHeight, height);
sp<OMXCodec> encoder = sp<MediaSource> encoder =
OMXCodec::Create( OMXCodec::Create(
client.interface(), enc_meta, true /* createEncoder */, decoder); client.interface(), enc_meta, true /* createEncoder */, decoder);

View File

@ -33,7 +33,7 @@ struct OMXCodec : public MediaSource,
enum CreationFlags { enum CreationFlags {
kPreferSoftwareCodecs = 1, kPreferSoftwareCodecs = 1,
}; };
static sp<OMXCodec> Create( static sp<MediaSource> Create(
const sp<IOMX> &omx, const sp<IOMX> &omx,
const sp<MetaData> &meta, bool createEncoder, const sp<MetaData> &meta, bool createEncoder,
const sp<MediaSource> &source, const sp<MediaSource> &source,

View File

@ -274,7 +274,7 @@ void OMXCodec::findMatchingCodecs(
} }
// static // static
sp<OMXCodec> OMXCodec::Create( sp<MediaSource> OMXCodec::Create(
const sp<IOMX> &omx, const sp<IOMX> &omx,
const sp<MetaData> &meta, bool createEncoder, const sp<MetaData> &meta, bool createEncoder,
const sp<MediaSource> &source, const sp<MediaSource> &source,