Skip to content
Snippets Groups Projects
Commit 5d5fb59a authored by Philippe Gorley's avatar Philippe Gorley Committed by Philippe Gorley
Browse files

media_stream: add const reference in ctor

Also fixes a compilation warning by renaming ctor argument

Change-Id: I872100b9ca023eed5733d4fa848cb3e91403a02c
parent 9630c15e
Branches
No related tags found
No related merge requests found
......@@ -44,9 +44,9 @@ struct MediaStream {
MediaStream()
{}
MediaStream(std::string name, int fmt, rational<int> tb, int w, int h,
MediaStream(const std::string& streamName, int fmt, rational<int> tb, int w, int h,
rational<int> sar, rational<int> fr)
: name(name)
: name(streamName)
, format(fmt)
, isVideo(true)
, timeBase(tb)
......@@ -56,8 +56,8 @@ struct MediaStream {
, frameRate(fr)
{}
MediaStream(std::string name, int fmt, rational<int> tb, int sr, int channels)
: name(name)
MediaStream(const std::string& streamName, int fmt, rational<int> tb, int sr, int channels)
: name(streamName)
, format(fmt)
, isVideo(false)
, timeBase(tb)
......@@ -65,8 +65,8 @@ struct MediaStream {
, nbChannels(channels)
{}
MediaStream(std::string name, AudioFormat fmt)
: name(name)
MediaStream(const std::string& streamName, AudioFormat fmt)
: name(streamName)
, format(fmt.sampleFormat)
, isVideo(false)
, timeBase(1, fmt.sample_rate)
......@@ -74,12 +74,12 @@ struct MediaStream {
, nbChannels(fmt.nb_channels)
{}
MediaStream(std::string name, AVCodecContext* c)
: MediaStream(name, c, 0)
MediaStream(const std::string& streamName, AVCodecContext* c)
: MediaStream(streamName, c, 0)
{}
MediaStream(std::string name, AVCodecContext* c, int64_t firstTimestamp)
: name(name)
MediaStream(const std::string& streamName, AVCodecContext* c, int64_t firstTimestamp)
: name(streamName)
, firstTimestamp(firstTimestamp)
{
timeBase = c->time_base;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment