| 1 |
/* |
| 2 |
* Copyright (C) 2017-2018 Team Kodi |
| 3 |
* This file is part of Kodi - https://kodi.tv |
| 4 |
* |
| 5 |
* SPDX-License-Identifier: GPL-2.0-or-later |
| 6 |
* See LICENSES/README.md for more information. |
| 7 |
*/ |
| 8 |
|
| 9 |
#pragma once |
| 10 |
|
| 11 |
#include "IVideoInfoTagLoader.h" |
| 12 |
|
| 13 |
#include <string> |
| 14 |
#include <vector> |
| 15 |
|
| 16 |
struct AVFormatContext; |
| 17 |
struct AVIOContext; |
| 18 |
namespace XFILE |
| 19 |
{ |
| 20 |
class CFile; |
| 21 |
} |
| 22 |
|
| 23 |
//! \brief Video tag loader using FFMPEG. |
| 24 |
class CVideoTagLoaderFFmpeg : public VIDEO::IVideoInfoTagLoader |
| 25 |
{ |
| 26 |
public: |
| 27 |
//! \brief Constructor. |
| 28 |
CVideoTagLoaderFFmpeg(const CFileItem& item, |
| 29 |
const ADDON::ScraperPtr& info, |
| 30 |
bool lookInFolder); |
| 31 |
|
| 32 |
//! \brief Destructor. |
| 33 |
~CVideoTagLoaderFFmpeg() override; |
| 34 |
|
| 35 |
//! \brief Returns whether or not reader has info. |
| 36 |
bool HasInfo() const override; |
| 37 |
|
| 38 |
//! \brief Load "tag" from nfo file. |
| 39 |
//! \brief tag Tag to load info into |
| 40 |
CInfoScanner::INFO_TYPE Load(CVideoInfoTag& tag, bool, |
| 41 |
std::vector<EmbeddedArt>* art = nullptr) override; |
| 42 |
|
| 43 |
ADDON::ScraperPtr GetScraperInfo() const { return m_info; } |
| 44 |
|
| 45 |
protected: |
| 46 |
ADDON::ScraperPtr m_info; //!< Passed scraper info |
| 47 |
AVIOContext* m_ioctx = nullptr; //!< IO context for file |
| 48 |
AVFormatContext* m_fctx = nullptr; //!< Format context for file |
| 49 |
XFILE::CFile* m_file = nullptr; //!< VFS file handle for file |
| 50 |
mutable int m_metadata_stream = -1; //!< Stream holding kodi metadata (mkv) |
| 51 |
mutable bool m_override_data = false; //!< Data is for overriding |
| 52 |
|
| 53 |
//! \brief Load tags from MKV file. |
| 54 |
CInfoScanner::INFO_TYPE LoadMKV(CVideoInfoTag& tag, std::vector<EmbeddedArt>* art); |
| 55 |
|
| 56 |
//! \brief Load tags from MP4 file. |
| 57 |
CInfoScanner::INFO_TYPE LoadMP4(CVideoInfoTag& tag, std::vector<EmbeddedArt>* art); |
| 58 |
|
| 59 |
//! \brief Load tags from AVI file. |
| 60 |
CInfoScanner::INFO_TYPE LoadAVI(CVideoInfoTag& tag, std::vector<EmbeddedArt>* art); |
| 61 |
}; |
| 62 |
|