| 1 |
/* |
| 2 |
* Copyright (c) 2010-2022 Belledonne Communications SARL. |
| 3 |
* |
| 4 |
* This file is part of mediastreamer2 |
| 5 |
* (see https://gitlab.linphone.org/BC/public/mediastreamer2). |
| 6 |
* |
| 7 |
* This program is free software: you can redistribute it and/or modify |
| 8 |
* it under the terms of the GNU Affero General Public License as |
| 9 |
* published by the Free Software Foundation, either version 3 of the |
| 10 |
* License, or (at your option) any later version. |
| 11 |
* |
| 12 |
* This program is distributed in the hope that it will be useful, |
| 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
* GNU Affero General Public License for more details. |
| 16 |
* |
| 17 |
* You should have received a copy of the GNU Affero General Public License |
| 18 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 |
*/ |
| 20 |
|
| 21 |
#pragma once |
| 22 |
|
| 23 |
#include <vector> |
| 24 |
|
| 25 |
#include "media-codec-decoder.h" |
| 26 |
|
| 27 |
namespace mediastreamer { |
| 28 |
|
| 29 |
class MediaCodecH264Decoder : public MediaCodecDecoder { |
| 30 |
public: |
| 31 |
MediaCodecH264Decoder(); |
| 32 |
~MediaCodecH264Decoder(); |
| 33 |
bool setParameterSets(MSQueue *parameterSet, uint64_t timestamp) override; |
| 34 |
|
| 35 |
private: |
| 36 |
struct DeviceInfo { |
| 37 |
std::string manufacturer; |
| 38 |
std::string model; |
| 39 |
std::string platform; |
| 40 |
|
| 41 |
bool operator==(const DeviceInfo &info) const; |
| 42 |
bool weakEquals(const DeviceInfo &info) const; |
| 43 |
std::string toString() const; |
| 44 |
}; |
| 45 |
|
| 46 |
bool isNewPps(mblk_t *sps); |
| 47 |
static DeviceInfo getDeviceInfo(); |
| 48 |
|
| 49 |
mblk_t *_lastSps = nullptr; |
| 50 |
bool _resetOnPsReceiving = false; |
| 51 |
static const std::vector<const DeviceInfo> |
| 52 |
_tvDevices; // List of devices whose H264 hardware decoder needs to be initialized with the right definition |
| 53 |
}; |
| 54 |
|
| 55 |
} // namespace mediastreamer |