Commit e44d2962 authored by François Grisez's avatar François Grisez

Enable 'resetOnPs' workaround on 'Quad-Core Enjoy TV Box'

parent e871d021
......@@ -17,6 +17,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <algorithm>
#include <cstring>
#include <sys/system_properties.h>
......@@ -38,7 +39,7 @@ namespace mediastreamer {
MediaCodecH264Decoder::MediaCodecH264Decoder(): MediaCodecDecoder("video/avc") {
DeviceInfo info = getDeviceInfo();
ms_message("MediaCodecH264Decoder: got device info: %s", info.toString().c_str());
if (info == DeviceInfo({"rockchip", "X9-LX", "rk3288"})) {
if (find(_tvDevices.cbegin(), _tvDevices.cend(), info) != _tvDevices.cend()) {
ms_message("MediaCodecH264Decoder: enabling reset on new SPS/PPS mode");
_resetOnPsReceiving = true;
}
......@@ -75,7 +76,7 @@ bool MediaCodecH264Decoder::setParameterSets(MSQueue *parameterSet, uint64_t tim
return MediaCodecDecoder::setParameterSets(parameterSet, timestamp);
}
bool MediaCodecH264Decoder::DeviceInfo::operator==(const DeviceInfo &info) {
bool MediaCodecH264Decoder::DeviceInfo::operator==(const DeviceInfo &info) const {
return this->manufacturer == info.manufacturer
&& this->model == info.model
&& this->platform == info.platform;
......@@ -199,6 +200,11 @@ private:
mblk_t *_pps = nullptr;
};
const std::vector<const MediaCodecH264Decoder::DeviceInfo> MediaCodecH264Decoder::_tvDevices = {
{"Amlogic", "Quad-Core Enjoy TV Box", "gxl"},
{"rockchip", "X9-LX", "rk3288"}
};
}
using namespace mediastreamer;
......
......@@ -19,6 +19,8 @@
#pragma once
#include <vector>
#include "media-codec-decoder.h"
namespace mediastreamer {
......@@ -35,7 +37,7 @@ private:
std::string model;
std::string platform;
bool operator==(const DeviceInfo &info);
bool operator==(const DeviceInfo &info) const;
std::string toString() const;
};
......@@ -44,6 +46,7 @@ private:
mblk_t *_lastSps = nullptr;
bool _resetOnPsReceiving = false;
static const std::vector<const DeviceInfo> _tvDevices; // List of devices whose H264 hardware decoder needs to be initialized with the right definition
};
}
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