Streaming: Use const reference in place of copying
* Thanks to Markus for reporting.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user