summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDario Casalinuovo <b.vitruvio@gmail.com>2016-06-24 21:59:25 (GMT)
committerDario Casalinuovo <b.vitruvio@gmail.com>2016-06-24 23:13:10 (GMT)
commit4dd09daff7bec7b0bcf2f10b06ae653c67ef2654 (patch)
tree9e7fc5e9bbed46c432cd7259eb8258f771a5ffb8
parent7f28cdba0c50dd375644053c7ec8e5de3e3269cd (diff)
Streaming: Use const reference in place of copyingHEADhrev50372master
* Thanks to Markus for reporting.
-rw-r--r--headers/os/media/MediaFile.h12
-rw-r--r--headers/private/media/MediaExtractor.h2
-rw-r--r--headers/private/media/StreamerPlugin.h2
-rw-r--r--src/add-ons/media/plugins/http_streamer/HTTPStreamerPlugin.cpp2
-rw-r--r--src/add-ons/media/plugins/http_streamer/HTTPStreamerPlugin.h2
-rw-r--r--src/add-ons/media/plugins/rtsp_streamer/RTSPStreamerPlugin.cpp2
-rw-r--r--src/add-ons/media/plugins/rtsp_streamer/RTSPStreamerPlugin.h2
-rw-r--r--src/kits/media/MediaExtractor.cpp2
-rw-r--r--src/kits/media/MediaFile.cpp8
9 files changed, 18 insertions, 16 deletions
diff --git a/headers/os/media/MediaFile.h b/headers/os/media/MediaFile.h
index 1b43365..bcf1e4c 100644
--- a/headers/os/media/MediaFile.h
+++ b/headers/os/media/MediaFile.h
@@ -72,8 +72,8 @@ public:
// Additional constructors used to stream data from protocols
// supported by the Streamer API
- BMediaFile(BUrl url);
- BMediaFile(BUrl url, int32 flags);
+ BMediaFile(const BUrl& url);
+ BMediaFile(const BUrl& url, int32 flags);
// Read-Write streaming constructor
BMediaFile(BUrl destination,
const media_file_format* mfi,
@@ -84,7 +84,7 @@ public:
status_t SetTo(const entry_ref* ref);
status_t SetTo(BDataIO* destination);
// The streaming equivalent of SetTo
- status_t SetTo(BUrl url);
+ status_t SetTo(const BUrl& url);
status_t InitCheck() const;
@@ -179,9 +179,11 @@ private:
void _Init();
void _UnInit();
- void _InitReader(BDataIO* source, BUrl* url = NULL,
+ void _InitReader(BDataIO* source,
+ const BUrl* url = NULL,
int32 flags = 0);
- void _InitWriter(BDataIO* target, BUrl* url,
+ void _InitWriter(BDataIO* target,
+ const BUrl* url,
const media_file_format* fileFormat,
int32 flags);
diff --git a/headers/private/media/MediaExtractor.h b/headers/private/media/MediaExtractor.h
index ede1973..ae8200d 100644
--- a/headers/private/media/MediaExtractor.h
+++ b/headers/private/media/MediaExtractor.h
@@ -40,7 +40,7 @@ struct stream_info {
class MediaExtractor {
public:
MediaExtractor(BDataIO* source, int32 flags);
- MediaExtractor(BUrl url, int32 flags);
+ MediaExtractor(const BUrl& url, int32 flags);
~MediaExtractor();
diff --git a/headers/private/media/StreamerPlugin.h b/headers/private/media/StreamerPlugin.h
index ed3a5ac..4fdfef5 100644
--- a/headers/private/media/StreamerPlugin.h
+++ b/headers/private/media/StreamerPlugin.h
@@ -18,7 +18,7 @@ public:
Streamer();
virtual ~Streamer();
- virtual status_t Sniff(BUrl url, BDataIO** source) = 0;
+ virtual status_t Sniff(const BUrl& url, BDataIO** source) = 0;
private:
virtual void _ReservedStreamer1();
virtual void _ReservedStreamer2();
diff --git a/src/add-ons/media/plugins/http_streamer/HTTPStreamerPlugin.cpp b/src/add-ons/media/plugins/http_streamer/HTTPStreamerPlugin.cpp
index dee0c1c..eb49d88 100644
--- a/src/add-ons/media/plugins/http_streamer/HTTPStreamerPlugin.cpp
+++ b/src/add-ons/media/plugins/http_streamer/HTTPStreamerPlugin.cpp
@@ -20,7 +20,7 @@ HTTPStreamer::~HTTPStreamer()
status_t
-HTTPStreamer::Sniff(BUrl url, BDataIO** source)
+HTTPStreamer::Sniff(const BUrl& url, BDataIO** source)
{
HTTPMediaIO* ret = new HTTPMediaIO(url);
if (ret->InitCheck() == B_OK) {
diff --git a/src/add-ons/media/plugins/http_streamer/HTTPStreamerPlugin.h b/src/add-ons/media/plugins/http_streamer/HTTPStreamerPlugin.h
index 646bd91..e044ec4 100644
--- a/src/add-ons/media/plugins/http_streamer/HTTPStreamerPlugin.h
+++ b/src/add-ons/media/plugins/http_streamer/HTTPStreamerPlugin.h
@@ -14,7 +14,7 @@ public:
HTTPStreamer();
virtual ~HTTPStreamer();
- virtual status_t Sniff(BUrl url, BDataIO** source);
+ virtual status_t Sniff(const BUrl& url, BDataIO** source);
};
diff --git a/src/add-ons/media/plugins/rtsp_streamer/RTSPStreamerPlugin.cpp b/src/add-ons/media/plugins/rtsp_streamer/RTSPStreamerPlugin.cpp
index 5eeee54..752426b 100644
--- a/src/add-ons/media/plugins/rtsp_streamer/RTSPStreamerPlugin.cpp
+++ b/src/add-ons/media/plugins/rtsp_streamer/RTSPStreamerPlugin.cpp
@@ -15,7 +15,7 @@ RTSPStreamer::~RTSPStreamer()
status_t
-RTSPStreamer::Sniff(BUrl url, BDataIO** source)
+RTSPStreamer::Sniff(const BUrl& url, BDataIO** source)
{
RTSPMediaIO* ret = new RTSPMediaIO(url);
if (ret->InitCheck() == B_OK) {
diff --git a/src/add-ons/media/plugins/rtsp_streamer/RTSPStreamerPlugin.h b/src/add-ons/media/plugins/rtsp_streamer/RTSPStreamerPlugin.h
index a2d12c4..3bec1ae 100644
--- a/src/add-ons/media/plugins/rtsp_streamer/RTSPStreamerPlugin.h
+++ b/src/add-ons/media/plugins/rtsp_streamer/RTSPStreamerPlugin.h
@@ -9,7 +9,7 @@ public:
RTSPStreamer();
virtual ~RTSPStreamer();
- virtual status_t Sniff(BUrl url, BDataIO** source);
+ virtual status_t Sniff(const BUrl& url, BDataIO** source);
};
diff --git a/src/kits/media/MediaExtractor.cpp b/src/kits/media/MediaExtractor.cpp
index 9be372b..154dd50 100644
--- a/src/kits/media/MediaExtractor.cpp
+++ b/src/kits/media/MediaExtractor.cpp
@@ -64,7 +64,7 @@ MediaExtractor::MediaExtractor(BDataIO* source, int32 flags)
}
-MediaExtractor::MediaExtractor(BUrl url, int32 flags)
+MediaExtractor::MediaExtractor(const BUrl& url, int32 flags)
:
fExtractorThread(-1),
fReader(NULL),
diff --git a/src/kits/media/MediaFile.cpp b/src/kits/media/MediaFile.cpp
index 4629e9e..447ab3a 100644
--- a/src/kits/media/MediaFile.cpp
+++ b/src/kits/media/MediaFile.cpp
@@ -82,7 +82,7 @@ BMediaFile::BMediaFile(const media_file_format* mfi, int32 flags)
}
-BMediaFile::BMediaFile(BUrl url)
+BMediaFile::BMediaFile(const BUrl& url)
{
CALLED();
fDeleteSource = true;
@@ -91,7 +91,7 @@ BMediaFile::BMediaFile(BUrl url)
}
-BMediaFile::BMediaFile(BUrl url, int32 flags)
+BMediaFile::BMediaFile(const BUrl& url, int32 flags)
{
CALLED();
fDeleteSource = true;
@@ -471,7 +471,7 @@ BMediaFile::_UnInit()
void
-BMediaFile::_InitReader(BDataIO* source, BUrl* url, int32 flags)
+BMediaFile::_InitReader(BDataIO* source, const BUrl* url, int32 flags)
{
CALLED();
@@ -512,7 +512,7 @@ BMediaFile::_InitReader(BDataIO* source, BUrl* url, int32 flags)
void
-BMediaFile::_InitWriter(BDataIO* target, BUrl* url,
+BMediaFile::_InitWriter(BDataIO* target, const BUrl* url,
const media_file_format* fileFormat, int32 flags)
{
CALLED();