Commit 4d65148f authored by François Grisez's avatar François Grisez

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

(cherry picked from commit e44d2962)
parent 8bb86c5b
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
#include <algorithm>
#include <cstring> #include <cstring>
#include <sys/system_properties.h> #include <sys/system_properties.h>
...@@ -38,7 +39,7 @@ namespace mediastreamer { ...@@ -38,7 +39,7 @@ namespace mediastreamer {
MediaCodecH264Decoder::MediaCodecH264Decoder(): MediaCodecDecoder("video/avc") { MediaCodecH264Decoder::MediaCodecH264Decoder(): MediaCodecDecoder("video/avc") {
DeviceInfo info = getDeviceInfo(); DeviceInfo info = getDeviceInfo();
ms_message("MediaCodecH264Decoder: got device info: %s", info.toString().c_str()); 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"); ms_message("MediaCodecH264Decoder: enabling reset on new SPS/PPS mode");
_resetOnPsReceiving = true; _resetOnPsReceiving = true;
} }
...@@ -75,7 +76,7 @@ bool MediaCodecH264Decoder::setParameterSets(MSQueue *parameterSet, uint64_t tim ...@@ -75,7 +76,7 @@ bool MediaCodecH264Decoder::setParameterSets(MSQueue *parameterSet, uint64_t tim
return MediaCodecDecoder::setParameterSets(parameterSet, timestamp); 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 return this->manufacturer == info.manufacturer
&& this->model == info.model && this->model == info.model
&& this->platform == info.platform; && this->platform == info.platform;
...@@ -199,6 +200,11 @@ private: ...@@ -199,6 +200,11 @@ private:
mblk_t *_pps = nullptr; 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; using namespace mediastreamer;
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#pragma once #pragma once
#include <vector>
#include "media-codec-decoder.h" #include "media-codec-decoder.h"
namespace mediastreamer { namespace mediastreamer {
...@@ -35,7 +37,7 @@ private: ...@@ -35,7 +37,7 @@ private:
std::string model; std::string model;
std::string platform; std::string platform;
bool operator==(const DeviceInfo &info); bool operator==(const DeviceInfo &info) const;
std::string toString() const; std::string toString() const;
}; };
...@@ -44,6 +46,7 @@ private: ...@@ -44,6 +46,7 @@ private:
mblk_t *_lastSps = nullptr; mblk_t *_lastSps = nullptr;
bool _resetOnPsReceiving = false; 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