Add image codec support to MediaCodec
Adds a concept of a codec domain to MediaCodec which is one of video,
audio or image. Records metrics for image codecs and manages resources
for image codecs. Generalizes video width and video height to work for
images too.
Bytes sent to an image encoder and received from an encoder are not
tracked, which is different from video encoders. Concepts of priority,
frame rate, capture rate and operating rate are also not applicable to
image codecs.
Note: I'm not aware of any way to test the changes to MediaCodec, since
there is no unit test for this component and no device with an image
decoder exists yet. Let me know if you know of a way.
Test: presubmit passed
Bug: 209803992
Change-Id: Ic887d208608d231fdecb75412862bc5dccb60a3f
diff --git a/media/libmedia/MediaResource.cpp b/media/libmedia/MediaResource.cpp
index ec52a49..a6f0b60 100644
--- a/media/libmedia/MediaResource.cpp
+++ b/media/libmedia/MediaResource.cpp
@@ -43,10 +43,10 @@
}
//static
-MediaResource MediaResource::CodecResource(bool secure, bool video, int64_t instanceCount) {
+MediaResource MediaResource::CodecResource(bool secure, SubType subType, int64_t instanceCount) {
return MediaResource(
secure ? Type::kSecureCodec : Type::kNonSecureCodec,
- video ? SubType::kVideoCodec : SubType::kAudioCodec,
+ subType,
instanceCount);
}