11 #include "DVDStreamInfo.h"    12 #include "DVDVideoCodec.h"    13 #include "cores/VideoPlayer/Buffers/VideoBuffer.h"    14 #include "threads/SingleLock.h"    15 #include "threads/Thread.h"    16 #include "utils/Geometry.h"    18 #include <fmt/format.h>    19 #include <starfish-media-pipeline/StarfishMediaAPIs.h>    27   AVPixelFormat GetFormat()
 override { 
return AV_PIX_FMT_NONE; }
    31 enum class StarfishState
    42 struct fmt::formatter<StarfishState> : fmt::formatter<std::string_view>
    45   template<
typename FormatContext>
    46   constexpr 
auto format(
const StarfishState& state, FormatContext& ctx)
    48     const auto it = ms_stateMap.find(state);
    49     if (it == ms_stateMap.cend())
    50       throw std::range_error(
"no starfish state string found");
    52     return fmt::formatter<string_view>::format(it->second, ctx);
    56   static constexpr 
auto ms_stateMap = make_map<StarfishState, std::string_view>({
    57       {StarfishState::RESET, 
"Reset"},
    58       {StarfishState::FLUSHED, 
"Flushed"},
    59       {StarfishState::RUNNING, 
"Running"},
    60       {StarfishState::EOS, 
"EOS"},
    61       {StarfishState::ERROR, 
"Error"},
    63   static_assert(static_cast<size_t>(StarfishState::MAX) == ms_stateMap.size(),
    64                 "ms_stateMap doesn't match the size of StarfishState, did you forget to "    65                 "add/remove a mapping?");
    75   static std::unique_ptr<CDVDVideoCodec> Create(
CProcessInfo& processInfo);
    76   static bool Register();
    81   void Reset() 
override;
    83   VCReturn GetPicture(
VideoPicture* pVideoPicture) 
override;
    84   const char* 
GetName()
 override { 
return m_formatname.c_str(); }
    85   void SetCodecControl(
int flags) 
override;
    86   void SetSpeed(
int iSpeed) 
override;
    91   void UpdateFpsDuration();
    94   void PlayerCallback(
const int32_t type, 
const int64_t numValue, 
const char* strValue);
    95   static void PlayerCallback(
const int32_t type,
    96                              const int64_t numValue,
    99   static void AcbCallback(
   100       long acbId, 
long taskId, 
long eventType, 
long appState, 
long playState, 
const char* reply);
   101   std::unique_ptr<StarfishMediaAPIs> m_starfishMediaAPI;
   105   std::string m_codecname;
   106   std::string m_formatname{
"starfish"};
   107   bool m_opened{
false};
   108   int m_codecControlFlags;
   109   std::chrono::nanoseconds m_currentPlaytime{0};
   110   bool m_newFrame{
false};
   112   StarfishState m_state{StarfishState::FLUSHED};
   115   std::unique_ptr<CBitstreamConverter> m_bitstream;
   117   static constexpr 
auto ms_codecMap = make_map<AVCodecID, std::string_view>({
   118       {AV_CODEC_ID_VP8, 
"VP8"},
   119       {AV_CODEC_ID_VP9, 
"VP9"},
   120       {AV_CODEC_ID_AVS, 
"H264"},
   121       {AV_CODEC_ID_CAVS, 
"H264"},
   122       {AV_CODEC_ID_H264, 
"H264"},
   123       {AV_CODEC_ID_HEVC, 
"H265"},
   124       {AV_CODEC_ID_AV1, 
"AV1"},
   127   static constexpr 
auto ms_formatInfoMap = make_map<AVCodecID, std::string_view>({
   128       {AV_CODEC_ID_VP8, 
"starfish-vp8"},
   129       {AV_CODEC_ID_VP9, 
"starfish-vp9"},
   130       {AV_CODEC_ID_AVS, 
"starfish-h264"},
   131       {AV_CODEC_ID_CAVS, 
"starfish-h264"},
   132       {AV_CODEC_ID_H264, 
"starfish-h264"},
   133       {AV_CODEC_ID_HEVC, 
"starfish-h265"},
   134       {AV_CODEC_ID_AV1, 
"starfish-av1"},
   137   static constexpr 
auto ms_hdrInfoMap = make_map<AVColorTransferCharacteristic, std::string_view>({
   138       {AVCOL_TRC_SMPTE2084, 
"HDR10"},
   139       {AVCOL_TRC_ARIB_STD_B67, 
"HLG"},
   142   static std::atomic<bool> ms_instanceGuard;
 Definition: DVDStreamInfo.h:25
Definition: VideoBuffer.h:85
Definition: DVDVideoCodecStarfish.h:68
Definition: DVDCodecs.h:23
Definition: BitstreamConverter.h:85
Definition: ProcessInfo.h:26
Definition: DVDVideoCodec.h:36
Definition: DemuxPacket.h:22
const char * GetName() override
should return codecs name 
Definition: DVDVideoCodecStarfish.h:84
Definition: DVDVideoCodec.h:110
Definition: DVDVideoCodecStarfish.h:23