hrev52912 adds 2 changesets to branch 'master'
old head: cb19342b8059634e6422e0cd5d1e16ab93455120
new head: 83a69e16c5a72b183574ea508dc5435da60fe79d
overview:
https://git.haiku-os.org/haiku/log/?qt=range&q=83a69e16c5a7+%5Ecb19342b8059
----------------------------------------------------------------------------
2caa4ec7085b: codec_kit: Fix build
83a69e16c5a7: MediaExtractor and MediaWriter fix constness
* Fixes an ugly hack, where the codec was initialized in the
InitCheck and prevented the method to be const too.
[ Barrett17 <b.vitruvio@xxxxxxxxx> ]
----------------------------------------------------------------------------
5 files changed, 12 insertions(+), 9 deletions(-)
headers/os/codec/MediaExtractor.h | 4 ++--
headers/os/codec/MediaWriter.h | 5 +++--
headers/private/codec/PluginManager.h | 2 +-
src/kits/codec/MediaExtractor.cpp | 4 ++--
src/kits/codec/MediaWriter.cpp | 6 ++++--
############################################################################
Commit: 2caa4ec7085b09bda933c45b804550182bbdbc7d
URL: https://git.haiku-os.org/haiku/commit/?id=2caa4ec7085b
Author: Barrett17 <b.vitruvio@xxxxxxxxx>
Date: Thu Feb 21 16:36:55 2019 UTC
codec_kit: Fix build
----------------------------------------------------------------------------
diff --git a/headers/private/codec/PluginManager.h
b/headers/private/codec/PluginManager.h
index b3204eca4e..3b21cfa97d 100644
--- a/headers/private/codec/PluginManager.h
+++ b/headers/private/codec/PluginManager.h
@@ -63,7 +63,7 @@ public:
void
DestroyEncoder(BEncoder* encoder);
status_t
CreateStreamer(BStreamer** streamer,
- BUrl
url, BDataIO** source);
+ BUrl
url);
void
DestroyStreamer(BStreamer* streamer);
private:
############################################################################
Revision: hrev52912
Commit: 83a69e16c5a72b183574ea508dc5435da60fe79d
URL: https://git.haiku-os.org/haiku/commit/?id=83a69e16c5a7
Author: Barrett17 <b.vitruvio@xxxxxxxxx>
Date: Thu Feb 21 16:42:20 2019 UTC
MediaExtractor and MediaWriter fix constness
* Fixes an ugly hack, where the codec was initialized in the
InitCheck and prevented the method to be const too.
----------------------------------------------------------------------------
diff --git a/headers/os/codec/MediaExtractor.h
b/headers/os/codec/MediaExtractor.h
index 3aad3dd674..b2fd0c23cd 100644
--- a/headers/os/codec/MediaExtractor.h
+++ b/headers/os/codec/MediaExtractor.h
@@ -28,7 +28,7 @@ public:
//BMediaExtractor(BMediaStreamer* streamer);
~BMediaExtractor();
- status_t InitCheck();
+ status_t InitCheck() const;
BDataIO* Source() const;
@@ -39,7 +39,7 @@ public:
status_t GetStreamMetaData(int32
stream,
BMetaData* data) const;
- int32 CountStreams();
+ int32 CountStreams() const;
const media_format* EncodedFormat(int32 stream);
int64 CountFrames(int32
stream) const;
diff --git a/headers/os/codec/MediaWriter.h b/headers/os/codec/MediaWriter.h
index 3b6fda0db1..acef2f1071 100644
--- a/headers/os/codec/MediaWriter.h
+++ b/headers/os/codec/MediaWriter.h
@@ -22,7 +22,7 @@ public:
const
media_file_format& fileFormat);
~BMediaWriter();
- status_t InitCheck();
+ status_t InitCheck() const;
BDataIO* Target() const;
@@ -54,8 +54,9 @@ private:
void* cookie;
};
+ status_t fInitCheck;
BDataIO* fTarget;
- BWriter* fWriter;
+ BWriter* fWriter;
List<StreamInfo> fStreamInfos;
media_file_format fFileFormat;
diff --git a/src/kits/codec/MediaExtractor.cpp
b/src/kits/codec/MediaExtractor.cpp
index e26998b97e..abf0a7d895 100644
--- a/src/kits/codec/MediaExtractor.cpp
+++ b/src/kits/codec/MediaExtractor.cpp
@@ -184,7 +184,7 @@ BMediaExtractor::~BMediaExtractor()
status_t
-BMediaExtractor::InitCheck()
+BMediaExtractor::InitCheck() const
{
CALLED();
return fInitStatus;
@@ -215,7 +215,7 @@ BMediaExtractor::GetMetaData(BMetaData* data) const
int32
-BMediaExtractor::CountStreams()
+BMediaExtractor::CountStreams() const
{
CALLED();
return fStreamCount;
diff --git a/src/kits/codec/MediaWriter.cpp b/src/kits/codec/MediaWriter.cpp
index 234e7fe664..1fcc3edd5f 100644
--- a/src/kits/codec/MediaWriter.cpp
+++ b/src/kits/codec/MediaWriter.cpp
@@ -56,6 +56,8 @@ BMediaWriter::BMediaWriter(BDataIO* target, const
media_file_format& fileFormat)
CALLED();
gPluginManager.CreateWriter(&fWriter, fFileFormat, fTarget);
+
+ fInitCheck = fWriter->Init(&fFileFormat);
}
@@ -78,11 +80,11 @@ BMediaWriter::~BMediaWriter()
status_t
-BMediaWriter::InitCheck()
+BMediaWriter::InitCheck() const
{
CALLED();
- return fWriter != NULL ? fWriter->Init(&fFileFormat) : B_NO_INIT;
+ return fWriter != NULL ? fInitCheck : B_NO_INIT;
}