diff --git a/headers/os/media/MediaFile.h b/headers/os/media/MediaFile.h index 0a48f8055f..1b433659e5 100644 --- a/headers/os/media/MediaFile.h +++ b/headers/os/media/MediaFile.h @@ -72,10 +72,10 @@ public: // Additional constructors used to stream data from protocols // supported by the Streamer API - BMediaFile(BUrl* url); - BMediaFile(BUrl* url, int32 flags); + BMediaFile(BUrl url); + BMediaFile(BUrl url, int32 flags); // Read-Write streaming constructor - BMediaFile(BUrl* destination, + BMediaFile(BUrl destination, const media_file_format* mfi, int32 flags = 0); @@ -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(BUrl url); status_t InitCheck() const; diff --git a/headers/private/media/MediaExtractor.h b/headers/private/media/MediaExtractor.h index 91f65e3792..ede19737d1 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(BUrl url, int32 flags); ~MediaExtractor(); diff --git a/headers/private/media/MediaWriter.h b/headers/private/media/MediaWriter.h index df88014798..ef3ae8336d 100644 --- a/headers/private/media/MediaWriter.h +++ b/headers/private/media/MediaWriter.h @@ -22,7 +22,7 @@ class MediaWriter { public: MediaWriter(BDataIO* target, const media_file_format& fileFormat); - MediaWriter(BUrl* url, + MediaWriter(BUrl url, const media_file_format& fileFormat); ~MediaWriter(); diff --git a/headers/private/media/PluginManager.h b/headers/private/media/PluginManager.h index 6f08a3fba6..7b863b7928 100644 --- a/headers/private/media/PluginManager.h +++ b/headers/private/media/PluginManager.h @@ -61,7 +61,7 @@ public: void DestroyEncoder(Encoder* encoder); status_t CreateStreamer(Streamer** streamer, - BUrl* url, BDataIO** source); + BUrl url, BDataIO** source); void DestroyStreamer(Streamer* streamer); private: diff --git a/headers/private/media/StreamerPlugin.h b/headers/private/media/StreamerPlugin.h index 907134eb1e..ed3a5ac966 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(BUrl url, BDataIO** source) = 0; private: virtual void _ReservedStreamer1(); virtual void _ReservedStreamer2(); diff --git a/src/add-ons/media/plugins/http_streamer/HTTPMediaIO.cpp b/src/add-ons/media/plugins/http_streamer/HTTPMediaIO.cpp index 81012de964..079ab70650 100644 --- a/src/add-ons/media/plugins/http_streamer/HTTPMediaIO.cpp +++ b/src/add-ons/media/plugins/http_streamer/HTTPMediaIO.cpp @@ -72,7 +72,7 @@ private: }; -HTTPMediaIO::HTTPMediaIO(BUrl* url) +HTTPMediaIO::HTTPMediaIO(BUrl url) : BAdapterIO( B_MEDIA_STREAMING | B_MEDIA_SEEK_BACKWARD, @@ -84,7 +84,7 @@ HTTPMediaIO::HTTPMediaIO(BUrl* url) fListener = new FileListener(this); - fReq = BUrlProtocolRoster::MakeRequest(*url, + fReq = BUrlProtocolRoster::MakeRequest(url, fListener, fContext); fReq->Run(); diff --git a/src/add-ons/media/plugins/http_streamer/HTTPMediaIO.h b/src/add-ons/media/plugins/http_streamer/HTTPMediaIO.h index e68ff1c63e..cc4634e47a 100644 --- a/src/add-ons/media/plugins/http_streamer/HTTPMediaIO.h +++ b/src/add-ons/media/plugins/http_streamer/HTTPMediaIO.h @@ -17,7 +17,7 @@ class FileListener; class HTTPMediaIO : public BAdapterIO { public: - HTTPMediaIO(BUrl* url); + HTTPMediaIO(BUrl url); virtual ~HTTPMediaIO(); status_t InitCheck() const; diff --git a/src/add-ons/media/plugins/http_streamer/HTTPStreamerPlugin.cpp b/src/add-ons/media/plugins/http_streamer/HTTPStreamerPlugin.cpp index f9ba530e8b..dee0c1c7b0 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(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 bb879c6cf8..646bd918da 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(BUrl url, BDataIO** source); }; diff --git a/src/add-ons/media/plugins/rtsp_streamer/RTSPMediaIO.cpp b/src/add-ons/media/plugins/rtsp_streamer/RTSPMediaIO.cpp index 896f9bb507..a1edd998a2 100644 --- a/src/add-ons/media/plugins/rtsp_streamer/RTSPMediaIO.cpp +++ b/src/add-ons/media/plugins/rtsp_streamer/RTSPMediaIO.cpp @@ -10,7 +10,7 @@ #define LIVE555_VERBOSITY 1 -RTSPMediaIO::RTSPMediaIO(BUrl* ourUrl) +RTSPMediaIO::RTSPMediaIO(BUrl ourUrl) : BAdapterIO( B_MEDIA_STREAMING | B_MEDIA_MUTABLE_SIZE | B_MEDIA_SEEK_BACKWARD, @@ -25,7 +25,7 @@ RTSPMediaIO::RTSPMediaIO(BUrl* ourUrl) fScheduler = BasicTaskScheduler::createNew(); fEnv = BasicUsageEnvironment::createNew(*fScheduler); - fClient = new HaikuRTSPClient(*fEnv, fUrl->UrlString(), + fClient = new HaikuRTSPClient(*fEnv, fUrl.UrlString(), 0, this); if (fClient == NULL) return; diff --git a/src/add-ons/media/plugins/rtsp_streamer/RTSPMediaIO.h b/src/add-ons/media/plugins/rtsp_streamer/RTSPMediaIO.h index d439023e85..8e234ccbd9 100644 --- a/src/add-ons/media/plugins/rtsp_streamer/RTSPMediaIO.h +++ b/src/add-ons/media/plugins/rtsp_streamer/RTSPMediaIO.h @@ -18,7 +18,7 @@ class HaikuRTSPClient; class RTSPMediaIO : public BAdapterIO { public: - RTSPMediaIO(BUrl* ourUrl); + RTSPMediaIO(BUrl ourUrl); virtual ~RTSPMediaIO(); status_t InitCheck() const; @@ -34,7 +34,7 @@ public: private: static int32 _LoopThread(void* data); - BUrl* fUrl; + BUrl fUrl; HaikuRTSPClient* fClient; UsageEnvironment* fEnv; diff --git a/src/add-ons/media/plugins/rtsp_streamer/RTSPStreamerPlugin.cpp b/src/add-ons/media/plugins/rtsp_streamer/RTSPStreamerPlugin.cpp index 001d804ec2..5eeee547f5 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(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 5ec8b01f5e..a2d12c4e17 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(BUrl url, BDataIO** source); }; diff --git a/src/apps/mediaplayer/playlist/Playlist.cpp b/src/apps/mediaplayer/playlist/Playlist.cpp index e43cba7fc8..a4dd78d53d 100644 --- a/src/apps/mediaplayer/playlist/Playlist.cpp +++ b/src/apps/mediaplayer/playlist/Playlist.cpp @@ -637,7 +637,7 @@ Playlist::_ExtraMediaExists(Playlist* playlist, const entry_ref& ref) /*static*/ bool -Playlist::_ExtraMediaExists(Playlist* playlist, BUrl* url) +Playlist::_ExtraMediaExists(Playlist* playlist, BUrl url) { for (int32 i = 0; i < playlist->CountItems(); i++) { UrlPlaylistItem* compare diff --git a/src/apps/mediaplayer/playlist/Playlist.h b/src/apps/mediaplayer/playlist/Playlist.h index 94980c59af..a048d789ba 100644 --- a/src/apps/mediaplayer/playlist/Playlist.h +++ b/src/apps/mediaplayer/playlist/Playlist.h @@ -128,7 +128,7 @@ private: static bool _ExtraMediaExists(Playlist* playlist, const entry_ref& ref); static bool _ExtraMediaExists(Playlist* playlist, - BUrl* url); + BUrl url); static bool _IsImageFile(const BString& mimeString); static bool _IsMediaFile(const BString& mimeString); static bool _IsTextPlaylist(const BString& mimeString); diff --git a/src/apps/mediaplayer/playlist/UrlPlaylistItem.cpp b/src/apps/mediaplayer/playlist/UrlPlaylistItem.cpp index 44f42322d4..a811fa9e00 100644 --- a/src/apps/mediaplayer/playlist/UrlPlaylistItem.cpp +++ b/src/apps/mediaplayer/playlist/UrlPlaylistItem.cpp @@ -11,7 +11,7 @@ #include "MediaFileTrackSupplier.h" -UrlPlaylistItem::UrlPlaylistItem(BUrl* url) +UrlPlaylistItem::UrlPlaylistItem(BUrl url) : fUrl(url) { @@ -21,7 +21,7 @@ UrlPlaylistItem::UrlPlaylistItem(BUrl* url) UrlPlaylistItem::UrlPlaylistItem(const UrlPlaylistItem& item) { - fUrl = new BUrl(item.Url()->UrlString()); + fUrl = BUrl(item.Url()); } @@ -39,7 +39,7 @@ UrlPlaylistItem::~UrlPlaylistItem() PlaylistItem* UrlPlaylistItem::Clone() const { - return new UrlPlaylistItem(new BUrl(fUrl->UrlString())); + return new UrlPlaylistItem(fUrl); } @@ -102,7 +102,7 @@ UrlPlaylistItem::GetAttribute(const Attribute& attribute, int64& value) const BString UrlPlaylistItem::LocationURI() const { - return fUrl->UrlString(); + return fUrl.UrlString(); } @@ -147,7 +147,7 @@ UrlPlaylistItem::CreateTrackSupplier() const } -BUrl* +BUrl UrlPlaylistItem::Url() const { return fUrl; diff --git a/src/apps/mediaplayer/playlist/UrlPlaylistItem.h b/src/apps/mediaplayer/playlist/UrlPlaylistItem.h index 93c351157f..cf911f0bff 100644 --- a/src/apps/mediaplayer/playlist/UrlPlaylistItem.h +++ b/src/apps/mediaplayer/playlist/UrlPlaylistItem.h @@ -12,7 +12,7 @@ class UrlPlaylistItem : public PlaylistItem { public: - UrlPlaylistItem(BUrl* url); + UrlPlaylistItem(BUrl url); UrlPlaylistItem(const UrlPlaylistItem& item); UrlPlaylistItem(const BMessage* archive); virtual ~UrlPlaylistItem(); @@ -47,10 +47,10 @@ public: virtual TrackSupplier* CreateTrackSupplier() const; - BUrl* Url() const; + BUrl Url() const; private: - BUrl* fUrl; + BUrl fUrl; }; #endif diff --git a/src/kits/media/Jamfile b/src/kits/media/Jamfile index eeefaff467..a23c54281d 100644 --- a/src/kits/media/Jamfile +++ b/src/kits/media/Jamfile @@ -93,7 +93,8 @@ for architectureObject in [ MultiArchSubDirSetup ] { StreamerPlugin.cpp WriterPlugin.cpp : - be localestub shared [ TargetLibsupc++ ] [ TargetLibstdc++ ] + be localestub shared bnetapi + [ TargetLibsupc++ ] [ TargetLibstdc++ ] ; } } diff --git a/src/kits/media/MediaExtractor.cpp b/src/kits/media/MediaExtractor.cpp index 2847782179..9be372bf99 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(BUrl url, int32 flags) : fExtractorThread(-1), fReader(NULL), diff --git a/src/kits/media/MediaFile.cpp b/src/kits/media/MediaFile.cpp index f93d27bdf0..4629e9e518 100644 --- a/src/kits/media/MediaFile.cpp +++ b/src/kits/media/MediaFile.cpp @@ -82,31 +82,31 @@ BMediaFile::BMediaFile(const media_file_format* mfi, int32 flags) } -BMediaFile::BMediaFile(BUrl* url) +BMediaFile::BMediaFile(BUrl url) { CALLED(); fDeleteSource = true; _Init(); - _InitReader(NULL, url); + _InitReader(NULL, &url); } -BMediaFile::BMediaFile(BUrl* url, int32 flags) +BMediaFile::BMediaFile(BUrl url, int32 flags) { CALLED(); fDeleteSource = true; _Init(); - _InitReader(NULL, url, flags); + _InitReader(NULL, &url, flags); } -BMediaFile::BMediaFile(BUrl* destination, const media_file_format* mfi, +BMediaFile::BMediaFile(BUrl destination, const media_file_format* mfi, int32 flags) { CALLED(); fDeleteSource = true; _Init(); - _InitWriter(NULL, destination, mfi, flags); + _InitWriter(NULL, &destination, mfi, flags); // TODO: Implement streaming server support, it's // a pretty complex thing compared to client mode // and will require to expand the current BMediaFile @@ -488,7 +488,7 @@ BMediaFile::_InitReader(BDataIO* source, BUrl* url, int32 flags) } fExtractor = new(std::nothrow) MediaExtractor(source, flags); } else - fExtractor = new(std::nothrow) MediaExtractor(url, flags); + fExtractor = new(std::nothrow) MediaExtractor(*url, flags); if (fExtractor == NULL) fErr = B_NO_MEMORY; @@ -532,7 +532,7 @@ BMediaFile::_InitWriter(BDataIO* target, BUrl* url, if (target != NULL) fWriter = new(std::nothrow) MediaWriter(target, fMFI); else - fWriter = new(std::nothrow) MediaWriter(url, fMFI); + fWriter = new(std::nothrow) MediaWriter(*url, fMFI); if (fWriter == NULL) fErr = B_NO_MEMORY; diff --git a/src/kits/media/MediaWriter.cpp b/src/kits/media/MediaWriter.cpp index b9e063edca..dd9847cba9 100644 --- a/src/kits/media/MediaWriter.cpp +++ b/src/kits/media/MediaWriter.cpp @@ -58,7 +58,7 @@ MediaWriter::MediaWriter(BDataIO* target, const media_file_format& fileFormat) } -MediaWriter::MediaWriter(BUrl* url, const media_file_format& fileFormat) +MediaWriter::MediaWriter(BUrl url, const media_file_format& fileFormat) : fTarget(NULL), fWriter(NULL), diff --git a/src/kits/media/PluginManager.cpp b/src/kits/media/PluginManager.cpp index 80855666cc..c26fa3aec8 100644 --- a/src/kits/media/PluginManager.cpp +++ b/src/kits/media/PluginManager.cpp @@ -595,7 +595,7 @@ PluginManager::DestroyEncoder(Encoder* encoder) status_t -PluginManager::CreateStreamer(Streamer** streamer, BUrl* url, BDataIO** source) +PluginManager::CreateStreamer(Streamer** streamer, BUrl url, BDataIO** source) { TRACE("PluginManager::CreateStreamer enter\n"); diff --git a/src/tests/kits/media/streamer_sniff_test/main.cpp b/src/tests/kits/media/streamer_sniff_test/main.cpp index 61b17caa5c..2a9e2b4b5a 100644 --- a/src/tests/kits/media/streamer_sniff_test/main.cpp +++ b/src/tests/kits/media/streamer_sniff_test/main.cpp @@ -19,8 +19,8 @@ int main(int argc, char *argv[]) printf("Instantiating the BMediaFile\n"); - BUrl* url = new BUrl(argv[1]); - if (!url->IsValid()) { + BUrl url = BUrl(argv[1]); + if (!url.IsValid()) { printf("Invalid URL\n"); return 0; }