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 {
public:
static inline constexpr AVMediaType avMediaType = static_cast<AVMediaType>(AVMEDIA_TYPE);
protected:
using Super = AbstractMediaStream<AVMEDIA_TYPE>;
protected:
AbstractMediaStream(AVCodec *streamCodec, AVFormatContext *formatArg, AVStream *streamArg,
int index)
......@@ -117,6 +120,9 @@ public:
using StreamPtr = std::shared_ptr<Stream>;
using StreamWeakPtr = std::weak_ptr<Stream>;
protected:
using Super = AbstractMediaContext<Stream>;
public:
AbstractMediaContext(const QString &path)
: filePath(path)
......
......@@ -27,15 +27,11 @@ class AudioContext;
// the AudioContext class.
class AudioStream final : public AbstractMediaStream<AVMEDIA_TYPE_AUDIO> {
VIVY_UNMOVABLE_OBJECT(AudioStream)
using Super = AbstractMediaStream<AVMEDIA_TYPE_AUDIO>;
public:
AudioStream(AVCodec *, AVFormatContext *, AVStream *, int index);
~AudioStream() noexcept override;
// The non-owning view of the stream's data
using DataWeakPtr = std::weak_ptr<double[]>;
// Decode the stream
void decodeData();
void cleanUpData() noexcept;
......@@ -72,7 +68,6 @@ private:
// from it.
class AudioContext final : public AbstractMediaContext<AudioStream> {
VIVY_UNMOVABLE_OBJECT(AudioContext)
using Super = AbstractMediaContext<AudioStream>;
public:
using StreamPtr = std::shared_ptr<AudioStream>;
......
......@@ -25,7 +25,6 @@ namespace Vivy
// VideoContext instance.
class VideoStream final : public AbstractMediaStream<AVMEDIA_TYPE_VIDEO> {
VIVY_UNMOVABLE_OBJECT(VideoStream)
using Super = AbstractMediaStream<AVMEDIA_TYPE_VIDEO>;
public:
VideoStream(AVCodec *, AVFormatContext *, AVStream *, int index);
......@@ -47,7 +46,6 @@ private:
// Like an audio context, but for videos.
class VideoContext final : public AbstractMediaContext<VideoStream> {
VIVY_UNMOVABLE_OBJECT(VideoContext)
using Super = AbstractMediaContext<VideoStream>;
public:
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