Commit bf97dc85 authored by François Grisez's avatar François Grisez
Browse files

Set the default profile and level in conformance with RFC 7798.

parent 0f57f21e
......@@ -291,8 +291,8 @@ int MediaCodecEncoderFilterImpl::encConfigure() {
AMediaFormat_setInt32(format, "bitrate", (_vconf.required_bitrate * 9)/10); /*take a margin*/
AMediaFormat_setInt32(format, "frame-rate", _vconf.fps);
AMediaFormat_setInt32(format, "bitrate-mode", 1);
AMediaFormat_setInt32(format, "profile", 1); // AVCProfileBaseline
AMediaFormat_setInt32(format, "level", 1024); // AVCLevel32
AMediaFormat_setInt32(format, "profile", _profile);
AMediaFormat_setInt32(format, "level", _level);
ms_message("MSMediaCodecH264Enc: AMediaImage is available.");
status = tryColorFormat(format, 0x7f420888);/*the new "flexible YUV", appeared in API23*/
......
......@@ -68,6 +68,8 @@ protected:
const MSVideoConfiguration *_vconfList;
MSVideoConfiguration _vconf;
bool _avpfEnabled = false;
int _profile = 0;
int _level = 0;
MSFilter *_f = nullptr;
std::string _mime;
......
......@@ -44,6 +44,8 @@ public:
MediaCodecH264EncoderFilterImpl(MSFilter *f): MediaCodecEncoderFilterImpl(f, "video/avc", new H264NalPacker()) {
_vconfList = _media_codec_h264_conf_list;
_profile = 1; // AVCProfileBaseline
_level = 1024; // AVCLevel32
}
~MediaCodecH264EncoderFilterImpl() {
......
......@@ -24,7 +24,10 @@ namespace mediastreamer {
class MediaCodecH265EncoderFilterImpl: public MediaCodecEncoderFilterImpl {
public:
MediaCodecH265EncoderFilterImpl(MSFilter *f): MediaCodecEncoderFilterImpl(f, "video/hevc", new H265NalPacker(f->factory)) {}
MediaCodecH265EncoderFilterImpl(MSFilter *f): MediaCodecEncoderFilterImpl(f, "video/hevc", new H265NalPacker(f->factory)) {
_profile = 1; // HEVCProfileMain
_level = 256; // HEVCMainTierLevel31
}
static void onFilterInit(MSFilter *f) {
f->data = new MediaCodecH265EncoderFilterImpl(f);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment