| | |
| | | PL_AndroidMediaCodecEncoder_Config* config = (PL_AndroidMediaCodecEncoder_Config*)args;
|
| | | in->config = *config;
|
| | |
|
| | | // see: developer.android.com/reference/android/media/MediaFormat.html#KEY_PROFILE
|
| | | AMediaFormat* format = AMediaFormat_new();
|
| | |
|
| | | AMediaFormat_setString(format, AMEDIAFORMAT_KEY_MIME, config->ak_mime.c_str());
|
| | |
| | | #define AMEDIA_COLOR_FormatYUV420Flexible 0x7f420888
|
| | | AMediaFormat_setInt32(format, AMEDIAFORMAT_KEY_COLOR_FORMAT, config->ak_color_format);
|
| | | //AMediaFormat_setInt32(format, AMEDIAFORMAT_KEY_STRIDE, config->ak_width * 2);
|
| | |
|
| | | if (config->codecProfileLevel.profile != 0)
|
| | | AMediaFormat_setInt32(format, "profile", config->codecProfileLevel.profile);
|
| | | if (config->codecProfileLevel.level != 0)
|
| | | AMediaFormat_setInt32(format, "level", config->codecProfileLevel.level);
|
| | |
|
| | |
|
| | | //uint8_t sps[] = {0x0,0x0,0x0,0x1, 0x67, 0x42, 0x00, 0x2A, 0x95, 0xA8, 0x1E, 0x00, 0x89, 0xF9, 0x61, 0x00, 0x00, 0x07, 0x08, 0x00, 0x01, 0x5F, 0x90, 0x04};
|
| | | //uint8_t pps[] = {0x0,0x0,0x0,0x1, 0x68, 0xCE, 0x3C, 0x80};
|
| | |
| | |
|
| | | if (spsSize != 0)
|
| | | {
|
| | | std::string spsStr = base64_encode(((const char*)sps) + 4, spsSize - 4);//#todo aux
|
| | | std::string ppsStr = base64_encode(((const char*)pps) + 4, ppsSize - 4);
|
| | | char* tmp = nullptr;
|
| | | std::string spsStr = tmp = base64_encode(((const char*)sps) + 4, spsSize - 4);//#todo aux
|
| | | delete[] tmp;
|
| | | std::string ppsStr = tmp = base64_encode(((const char*)pps) + 4, ppsSize - 4);
|
| | | delete[] tmp;
|
| | | tmp = nullptr;
|
| | |
|
| | | this->manager->set_param(PLGP_ENC_SPS_B64, spsStr);
|
| | | this->manager->set_param(PLGP_ENC_PPS_B64, ppsStr);
|