moved more objects to shared ptrs
This commit is contained in:
@@ -42,12 +42,12 @@ Decoder::~Decoder()
|
||||
{
|
||||
}
|
||||
|
||||
const Stream *Decoder::stream()
|
||||
StreamPtr Decoder::stream()
|
||||
{
|
||||
return stream_;
|
||||
}
|
||||
|
||||
void Decoder::set_stream(const Stream *fs)
|
||||
void Decoder::set_stream(StreamPtr fs)
|
||||
{
|
||||
Close();
|
||||
|
||||
|
||||
@@ -80,8 +80,8 @@ public:
|
||||
|
||||
virtual QString id() = 0;
|
||||
|
||||
const Stream* stream();
|
||||
void set_stream(const Stream *fs);
|
||||
StreamPtr stream();
|
||||
void set_stream(StreamPtr fs);
|
||||
|
||||
/**
|
||||
* @brief Probe a footage file and dump metadata about it
|
||||
@@ -194,7 +194,7 @@ protected:
|
||||
bool open_;
|
||||
|
||||
private:
|
||||
const Stream* stream_;
|
||||
StreamPtr stream_;
|
||||
};
|
||||
|
||||
#endif // DECODER_H
|
||||
|
||||
@@ -346,12 +346,12 @@ bool FFmpegDecoder::Probe(Footage *f)
|
||||
|
||||
avstream_ = fmt_ctx_->streams[i];
|
||||
|
||||
Stream* str;
|
||||
StreamPtr str;
|
||||
|
||||
if (avstream_->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
|
||||
|
||||
// Create a video stream object
|
||||
VideoStream* video_stream = new VideoStream();
|
||||
VideoStreamPtr video_stream = std::make_shared<VideoStream>();
|
||||
|
||||
video_stream->set_width(avstream_->codecpar->width);
|
||||
video_stream->set_height(avstream_->codecpar->height);
|
||||
@@ -361,7 +361,7 @@ bool FFmpegDecoder::Probe(Footage *f)
|
||||
} else if (avstream_->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
|
||||
|
||||
// Create an audio stream object
|
||||
AudioStream* audio_stream = new AudioStream();
|
||||
AudioStreamPtr audio_stream = std::make_shared<AudioStream>();
|
||||
|
||||
audio_stream->set_layout(avstream_->codecpar->channel_layout);
|
||||
audio_stream->set_channels(avstream_->codecpar->channels);
|
||||
@@ -372,7 +372,7 @@ bool FFmpegDecoder::Probe(Footage *f)
|
||||
} else {
|
||||
|
||||
// This is data we can't utilize at the moment, but we make a Stream object anyway to keep parity with the file
|
||||
str = new Stream();
|
||||
str = std::make_shared<Stream>();
|
||||
|
||||
// Set the correct codec type based on FFmpeg's result
|
||||
switch (avstream_->codecpar->codec_type) {
|
||||
|
||||
Reference in New Issue
Block a user