Loading media/codec2/components/mpeg2/C2SoftMpeg2Dec.cpp +7 −6 Original line number Original line Diff line number Diff line Loading @@ -30,6 +30,7 @@ namespace android { namespace android { constexpr size_t kMinInputBufferSize = 2 * 1024 * 1024; constexpr size_t kMinInputBufferSize = 2 * 1024 * 1024; constexpr size_t kMaxDimension = 1920; constexpr char COMPONENT_NAME[] = "c2.android.mpeg2.decoder"; constexpr char COMPONENT_NAME[] = "c2.android.mpeg2.decoder"; class C2SoftMpeg2Dec::IntfImpl : public SimpleInterface<void>::BaseParams { class C2SoftMpeg2Dec::IntfImpl : public SimpleInterface<void>::BaseParams { Loading Loading @@ -64,8 +65,8 @@ public: DefineParam(mSize, C2_PARAMKEY_PICTURE_SIZE) DefineParam(mSize, C2_PARAMKEY_PICTURE_SIZE) .withDefault(new C2StreamPictureSizeInfo::output(0u, 320, 240)) .withDefault(new C2StreamPictureSizeInfo::output(0u, 320, 240)) .withFields({ .withFields({ C2F(mSize, width).inRange(16, 1920, 4), C2F(mSize, width).inRange(16, kMaxDimension, 2), C2F(mSize, height).inRange(16, 1088, 4), C2F(mSize, height).inRange(16, kMaxDimension, 2), }) }) .withSetter(SizeSetter) .withSetter(SizeSetter) .build()); .build()); Loading @@ -91,8 +92,8 @@ public: DefineParam(mMaxSize, C2_PARAMKEY_MAX_PICTURE_SIZE) DefineParam(mMaxSize, C2_PARAMKEY_MAX_PICTURE_SIZE) .withDefault(new C2StreamMaxPictureSizeTuning::output(0u, 320, 240)) .withDefault(new C2StreamMaxPictureSizeTuning::output(0u, 320, 240)) .withFields({ .withFields({ C2F(mSize, width).inRange(2, 1920, 2), C2F(mSize, width).inRange(2, kMaxDimension, 2), C2F(mSize, height).inRange(2, 1088, 2), C2F(mSize, height).inRange(2, kMaxDimension, 2), }) }) .withSetter(MaxPictureSizeSetter, mSize) .withSetter(MaxPictureSizeSetter, mSize) .build()); .build()); Loading Loading @@ -204,8 +205,8 @@ public: const C2P<C2StreamPictureSizeInfo::output> &size) { const C2P<C2StreamPictureSizeInfo::output> &size) { (void)mayBlock; (void)mayBlock; // TODO: get max width/height from the size's field helpers vs. hardcoding // TODO: get max width/height from the size's field helpers vs. hardcoding me.set().width = c2_min(c2_max(me.v.width, size.v.width), 1920u); me.set().width = c2_min(c2_max(me.v.width, size.v.width), kMaxDimension); me.set().height = c2_min(c2_max(me.v.height, size.v.height), 1088u); me.set().height = c2_min(c2_max(me.v.height, size.v.height), kMaxDimension); return C2R::Ok(); return C2R::Ok(); } } Loading media/codec2/components/mpeg4_h263/C2SoftMpeg4Dec.cpp +8 −25 Original line number Original line Diff line number Diff line Loading @@ -35,8 +35,10 @@ namespace android { namespace android { constexpr size_t kMinInputBufferSize = 2 * 1024 * 1024; constexpr size_t kMinInputBufferSize = 2 * 1024 * 1024; #ifdef MPEG4 #ifdef MPEG4 constexpr size_t kMaxDimension = 1920; constexpr char COMPONENT_NAME[] = "c2.android.mpeg4.decoder"; constexpr char COMPONENT_NAME[] = "c2.android.mpeg4.decoder"; #else #else constexpr size_t kMaxDimension = 352; constexpr char COMPONENT_NAME[] = "c2.android.h263.decoder"; constexpr char COMPONENT_NAME[] = "c2.android.h263.decoder"; #endif #endif Loading Loading @@ -75,13 +77,8 @@ public: DefineParam(mSize, C2_PARAMKEY_PICTURE_SIZE) DefineParam(mSize, C2_PARAMKEY_PICTURE_SIZE) .withDefault(new C2StreamPictureSizeInfo::output(0u, 176, 144)) .withDefault(new C2StreamPictureSizeInfo::output(0u, 176, 144)) .withFields({ .withFields({ #ifdef MPEG4 C2F(mSize, width).inRange(2, kMaxDimension, 2), C2F(mSize, width).inRange(2, 1920, 2), C2F(mSize, height).inRange(2, kMaxDimension, 2), C2F(mSize, height).inRange(2, 1088, 2), #else C2F(mSize, width).inRange(2, 352, 2), C2F(mSize, height).inRange(2, 288, 2), #endif }) }) .withSetter(SizeSetter) .withSetter(SizeSetter) .build()); .build()); Loading Loading @@ -130,19 +127,10 @@ public: addParameter( addParameter( DefineParam(mMaxSize, C2_PARAMKEY_MAX_PICTURE_SIZE) DefineParam(mMaxSize, C2_PARAMKEY_MAX_PICTURE_SIZE) #ifdef MPEG4 .withDefault(new C2StreamMaxPictureSizeTuning::output(0u, 1920, 1088)) #else .withDefault(new C2StreamMaxPictureSizeTuning::output(0u, 352, 288)) .withDefault(new C2StreamMaxPictureSizeTuning::output(0u, 352, 288)) #endif .withFields({ .withFields({ #ifdef MPEG4 C2F(mSize, width).inRange(2, kMaxDimension, 2), C2F(mSize, width).inRange(2, 1920, 2), C2F(mSize, height).inRange(2, kMaxDimension, 2), C2F(mSize, height).inRange(2, 1088, 2), #else C2F(mSize, width).inRange(2, 352, 2), C2F(mSize, height).inRange(2, 288, 2), #endif }) }) .withSetter(MaxPictureSizeSetter, mSize) .withSetter(MaxPictureSizeSetter, mSize) .build()); .build()); Loading Loading @@ -200,13 +188,8 @@ public: const C2P<C2StreamPictureSizeInfo::output> &size) { const C2P<C2StreamPictureSizeInfo::output> &size) { (void)mayBlock; (void)mayBlock; // TODO: get max width/height from the size's field helpers vs. hardcoding // TODO: get max width/height from the size's field helpers vs. hardcoding #ifdef MPEG4 me.set().width = c2_min(c2_max(me.v.width, size.v.width), kMaxDimension); me.set().width = c2_min(c2_max(me.v.width, size.v.width), 1920u); me.set().height = c2_min(c2_max(me.v.height, size.v.height), kMaxDimension); me.set().height = c2_min(c2_max(me.v.height, size.v.height), 1088u); #else me.set().width = c2_min(c2_max(me.v.width, size.v.width), 352u); me.set().height = c2_min(c2_max(me.v.height, size.v.height), 288u); #endif return C2R::Ok(); return C2R::Ok(); } } Loading Loading
media/codec2/components/mpeg2/C2SoftMpeg2Dec.cpp +7 −6 Original line number Original line Diff line number Diff line Loading @@ -30,6 +30,7 @@ namespace android { namespace android { constexpr size_t kMinInputBufferSize = 2 * 1024 * 1024; constexpr size_t kMinInputBufferSize = 2 * 1024 * 1024; constexpr size_t kMaxDimension = 1920; constexpr char COMPONENT_NAME[] = "c2.android.mpeg2.decoder"; constexpr char COMPONENT_NAME[] = "c2.android.mpeg2.decoder"; class C2SoftMpeg2Dec::IntfImpl : public SimpleInterface<void>::BaseParams { class C2SoftMpeg2Dec::IntfImpl : public SimpleInterface<void>::BaseParams { Loading Loading @@ -64,8 +65,8 @@ public: DefineParam(mSize, C2_PARAMKEY_PICTURE_SIZE) DefineParam(mSize, C2_PARAMKEY_PICTURE_SIZE) .withDefault(new C2StreamPictureSizeInfo::output(0u, 320, 240)) .withDefault(new C2StreamPictureSizeInfo::output(0u, 320, 240)) .withFields({ .withFields({ C2F(mSize, width).inRange(16, 1920, 4), C2F(mSize, width).inRange(16, kMaxDimension, 2), C2F(mSize, height).inRange(16, 1088, 4), C2F(mSize, height).inRange(16, kMaxDimension, 2), }) }) .withSetter(SizeSetter) .withSetter(SizeSetter) .build()); .build()); Loading @@ -91,8 +92,8 @@ public: DefineParam(mMaxSize, C2_PARAMKEY_MAX_PICTURE_SIZE) DefineParam(mMaxSize, C2_PARAMKEY_MAX_PICTURE_SIZE) .withDefault(new C2StreamMaxPictureSizeTuning::output(0u, 320, 240)) .withDefault(new C2StreamMaxPictureSizeTuning::output(0u, 320, 240)) .withFields({ .withFields({ C2F(mSize, width).inRange(2, 1920, 2), C2F(mSize, width).inRange(2, kMaxDimension, 2), C2F(mSize, height).inRange(2, 1088, 2), C2F(mSize, height).inRange(2, kMaxDimension, 2), }) }) .withSetter(MaxPictureSizeSetter, mSize) .withSetter(MaxPictureSizeSetter, mSize) .build()); .build()); Loading Loading @@ -204,8 +205,8 @@ public: const C2P<C2StreamPictureSizeInfo::output> &size) { const C2P<C2StreamPictureSizeInfo::output> &size) { (void)mayBlock; (void)mayBlock; // TODO: get max width/height from the size's field helpers vs. hardcoding // TODO: get max width/height from the size's field helpers vs. hardcoding me.set().width = c2_min(c2_max(me.v.width, size.v.width), 1920u); me.set().width = c2_min(c2_max(me.v.width, size.v.width), kMaxDimension); me.set().height = c2_min(c2_max(me.v.height, size.v.height), 1088u); me.set().height = c2_min(c2_max(me.v.height, size.v.height), kMaxDimension); return C2R::Ok(); return C2R::Ok(); } } Loading
media/codec2/components/mpeg4_h263/C2SoftMpeg4Dec.cpp +8 −25 Original line number Original line Diff line number Diff line Loading @@ -35,8 +35,10 @@ namespace android { namespace android { constexpr size_t kMinInputBufferSize = 2 * 1024 * 1024; constexpr size_t kMinInputBufferSize = 2 * 1024 * 1024; #ifdef MPEG4 #ifdef MPEG4 constexpr size_t kMaxDimension = 1920; constexpr char COMPONENT_NAME[] = "c2.android.mpeg4.decoder"; constexpr char COMPONENT_NAME[] = "c2.android.mpeg4.decoder"; #else #else constexpr size_t kMaxDimension = 352; constexpr char COMPONENT_NAME[] = "c2.android.h263.decoder"; constexpr char COMPONENT_NAME[] = "c2.android.h263.decoder"; #endif #endif Loading Loading @@ -75,13 +77,8 @@ public: DefineParam(mSize, C2_PARAMKEY_PICTURE_SIZE) DefineParam(mSize, C2_PARAMKEY_PICTURE_SIZE) .withDefault(new C2StreamPictureSizeInfo::output(0u, 176, 144)) .withDefault(new C2StreamPictureSizeInfo::output(0u, 176, 144)) .withFields({ .withFields({ #ifdef MPEG4 C2F(mSize, width).inRange(2, kMaxDimension, 2), C2F(mSize, width).inRange(2, 1920, 2), C2F(mSize, height).inRange(2, kMaxDimension, 2), C2F(mSize, height).inRange(2, 1088, 2), #else C2F(mSize, width).inRange(2, 352, 2), C2F(mSize, height).inRange(2, 288, 2), #endif }) }) .withSetter(SizeSetter) .withSetter(SizeSetter) .build()); .build()); Loading Loading @@ -130,19 +127,10 @@ public: addParameter( addParameter( DefineParam(mMaxSize, C2_PARAMKEY_MAX_PICTURE_SIZE) DefineParam(mMaxSize, C2_PARAMKEY_MAX_PICTURE_SIZE) #ifdef MPEG4 .withDefault(new C2StreamMaxPictureSizeTuning::output(0u, 1920, 1088)) #else .withDefault(new C2StreamMaxPictureSizeTuning::output(0u, 352, 288)) .withDefault(new C2StreamMaxPictureSizeTuning::output(0u, 352, 288)) #endif .withFields({ .withFields({ #ifdef MPEG4 C2F(mSize, width).inRange(2, kMaxDimension, 2), C2F(mSize, width).inRange(2, 1920, 2), C2F(mSize, height).inRange(2, kMaxDimension, 2), C2F(mSize, height).inRange(2, 1088, 2), #else C2F(mSize, width).inRange(2, 352, 2), C2F(mSize, height).inRange(2, 288, 2), #endif }) }) .withSetter(MaxPictureSizeSetter, mSize) .withSetter(MaxPictureSizeSetter, mSize) .build()); .build()); Loading Loading @@ -200,13 +188,8 @@ public: const C2P<C2StreamPictureSizeInfo::output> &size) { const C2P<C2StreamPictureSizeInfo::output> &size) { (void)mayBlock; (void)mayBlock; // TODO: get max width/height from the size's field helpers vs. hardcoding // TODO: get max width/height from the size's field helpers vs. hardcoding #ifdef MPEG4 me.set().width = c2_min(c2_max(me.v.width, size.v.width), kMaxDimension); me.set().width = c2_min(c2_max(me.v.width, size.v.width), 1920u); me.set().height = c2_min(c2_max(me.v.height, size.v.height), kMaxDimension); me.set().height = c2_min(c2_max(me.v.height, size.v.height), 1088u); #else me.set().width = c2_min(c2_max(me.v.width, size.v.width), 352u); me.set().height = c2_min(c2_max(me.v.height, size.v.height), 288u); #endif return C2R::Ok(); return C2R::Ok(); } } Loading