I need help on Samsung S9+. All I am trying to do is to create a decoder and subsequently configure it to render to a surface. The configure step is failing. See the code and logs below.
Am I going wrong with the color format? This code is working fine on other devices, but not on Samsung S9+. I tried giving it the following value but to no avail:
COLOR_FormatSurface
Added in API level 18 public static final int COLOR_FormatSurface
Constant Value: 2130708361 (0x7f000789)
void func(AMediaFormat* mediaFormat, ANativeWindow* surface)
{
// ...
AMediaFormat_getString(mediaFormat, AMEDIAFORMAT_KEY_MIME, &mime);
AMediaCodec *videoDecoder = AMediaCodec_createDecoderByType(mime);
// this step is failing
media_status_t status = AMediaCodec_configure(videoDecoder, mediaFormat, surface, NULL, 0);
// ...
}
2019-04-02 11:25:48.578 999-17684/? E/OMX-VDEC-1080P: Unsupported output color format for c2d (2141391876)
2019-04-02 11:25:48.578 999-17684/? E/OMX-VDEC-1080P: Setting color format failed
2019-04-02 11:25:48.606 999-17684/? E/OMX-VDEC-1080P: Unsupported output color format for c2d (2141391876)
2019-04-02 11:25:48.606 999-17684/? E/OMX-VDEC-1080P: Setting color format failed
2019-04-02 11:25:48.613 15598-18889 E/NdkMediaCodec: configure: err(-5001), failed with format: AMessage(what = 0x00000000) = {
string mime = "video/avc"
int64_t durationUs = 91604722
int32_t isDMCMMExtractor = 1
int32_t track-id = 1
string language = "```"
int32_t width = 3840
int32_t height = 2160
int32_t display-width = 3840
int32_t display-height = 2160
int32_t color-range = 2
int32_t color-standard = 6
int32_t color-transfer = 3
int32_t max-input-size = 6291456
int32_t frame-rate = 30
int32_t profile = 8
int32_t level = 32768
Buffer csd-0 = {
00000000: 00 00 00 01 67 64 00 33 ac d2 00 f0 01 0f a5 60 ....gd.3.......`
00000010: c0 c0 c0 da 14 26 a0 .....&.
}
Buffer csd-1 = {
00000000: 00 00 00 01 68 ee 06 e2 c0 ....h....
}
int32_t color-format = 2130708361
RefBase *native-window = 0x73221a0000
}
User contributions licensed under CC BY-SA 3.0