Skip to content
Extraits de code Groupes Projets
Vérifiée Valider a96880c1 rédigé par Kubat's avatar Kubat
Parcourir les fichiers

LIB: The 'Super' typedef is set in the abstract context/stream for more...

LIB: The 'Super' typedef is set in the abstract context/stream for more factorisation and less error-prone code
parent eb088b89
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!18Implement the VivyDocument specification
...@@ -52,6 +52,9 @@ template <size_t AVMEDIA_TYPE> class AbstractMediaStream { ...@@ -52,6 +52,9 @@ template <size_t AVMEDIA_TYPE> class AbstractMediaStream {
public: public:
static inline constexpr AVMediaType avMediaType = static_cast<AVMediaType>(AVMEDIA_TYPE); static inline constexpr AVMediaType avMediaType = static_cast<AVMediaType>(AVMEDIA_TYPE);
protected:
using Super = AbstractMediaStream<AVMEDIA_TYPE>;
protected: protected:
AbstractMediaStream(AVCodec *streamCodec, AVFormatContext *formatArg, AVStream *streamArg, AbstractMediaStream(AVCodec *streamCodec, AVFormatContext *formatArg, AVStream *streamArg,
int index) int index)
...@@ -117,6 +120,9 @@ public: ...@@ -117,6 +120,9 @@ public:
using StreamPtr = std::shared_ptr<Stream>; using StreamPtr = std::shared_ptr<Stream>;
using StreamWeakPtr = std::weak_ptr<Stream>; using StreamWeakPtr = std::weak_ptr<Stream>;
protected:
using Super = AbstractMediaContext<Stream>;
public: public:
AbstractMediaContext(const QString &path) AbstractMediaContext(const QString &path)
: filePath(path) : filePath(path)
......
...@@ -27,15 +27,11 @@ class AudioContext; ...@@ -27,15 +27,11 @@ class AudioContext;
// the AudioContext class. // the AudioContext class.
class AudioStream final : public AbstractMediaStream<AVMEDIA_TYPE_AUDIO> { class AudioStream final : public AbstractMediaStream<AVMEDIA_TYPE_AUDIO> {
VIVY_UNMOVABLE_OBJECT(AudioStream) VIVY_UNMOVABLE_OBJECT(AudioStream)
using Super = AbstractMediaStream<AVMEDIA_TYPE_AUDIO>;
public: public:
AudioStream(AVCodec *, AVFormatContext *, AVStream *, int index); AudioStream(AVCodec *, AVFormatContext *, AVStream *, int index);
~AudioStream() noexcept override; ~AudioStream() noexcept override;
// The non-owning view of the stream's data
using DataWeakPtr = std::weak_ptr<double[]>;
// Decode the stream // Decode the stream
void decodeData(); void decodeData();
void cleanUpData() noexcept; void cleanUpData() noexcept;
...@@ -72,7 +68,6 @@ private: ...@@ -72,7 +68,6 @@ private:
// from it. // from it.
class AudioContext final : public AbstractMediaContext<AudioStream> { class AudioContext final : public AbstractMediaContext<AudioStream> {
VIVY_UNMOVABLE_OBJECT(AudioContext) VIVY_UNMOVABLE_OBJECT(AudioContext)
using Super = AbstractMediaContext<AudioStream>;
public: public:
using StreamPtr = std::shared_ptr<AudioStream>; using StreamPtr = std::shared_ptr<AudioStream>;
......
...@@ -25,7 +25,6 @@ namespace Vivy ...@@ -25,7 +25,6 @@ namespace Vivy
// VideoContext instance. // VideoContext instance.
class VideoStream final : public AbstractMediaStream<AVMEDIA_TYPE_VIDEO> { class VideoStream final : public AbstractMediaStream<AVMEDIA_TYPE_VIDEO> {
VIVY_UNMOVABLE_OBJECT(VideoStream) VIVY_UNMOVABLE_OBJECT(VideoStream)
using Super = AbstractMediaStream<AVMEDIA_TYPE_VIDEO>;
public: public:
VideoStream(AVCodec *, AVFormatContext *, AVStream *, int index); VideoStream(AVCodec *, AVFormatContext *, AVStream *, int index);
...@@ -47,7 +46,6 @@ private: ...@@ -47,7 +46,6 @@ private:
// Like an audio context, but for videos. // Like an audio context, but for videos.
class VideoContext final : public AbstractMediaContext<VideoStream> { class VideoContext final : public AbstractMediaContext<VideoStream> {
VIVY_UNMOVABLE_OBJECT(VideoContext) VIVY_UNMOVABLE_OBJECT(VideoContext)
using Super = AbstractMediaContext<VideoStream>;
public: public:
VideoContext(const QString &path); VideoContext(const QString &path);
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter