[haiku-commits] haiku: hrev50082 - in src/add-ons/media/media-add-ons: writer reader .

  • From: b.vitruvio@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 12 Feb 2016 23:27:56 +0100 (CET)

hrev50082 adds 1 changeset to branch 'master'
old head: b1d006d7f83b94afe737c16304edb045671578ac
new head: 44200efd5d6927b55ab8ef6be8e66b2e478c5f04
overview: 
http://cgit.haiku-os.org/haiku/log/?qt=range&q=44200efd5d69+%5Eb1d006d7f83b

----------------------------------------------------------------------------

44200efd5d69: media_reader/media_writer: Fix build

                                [ Dario Casalinuovo <b.vitruvio@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev50082
Commit:      44200efd5d6927b55ab8ef6be8e66b2e478c5f04
URL:         http://cgit.haiku-os.org/haiku/commit/?id=44200efd5d69
Author:      Dario Casalinuovo <b.vitruvio@xxxxxxxxx>
Date:        Fri Feb 12 22:00:52 2016 UTC

----------------------------------------------------------------------------

14 files changed, 72 insertions(+), 218 deletions(-)
src/add-ons/media/media-add-ons/Jamfile          |   5 +-
.../media/media-add-ons/{reader => }/misc.cpp    |   3 +-
.../media/media-add-ons/{reader => }/misc.h      |   0
src/add-ons/media/media-add-ons/reader/Jamfile   |   6 +-
.../media/media-add-ons/reader/MediaReader.cpp   |   6 +-
.../media/media-add-ons/reader/MediaReader.h     |   3 +
.../media-add-ons/reader/MediaReaderAddOn.h      |   3 +
src/add-ons/media/media-add-ons/writer/Jamfile   |   9 +-
.../media/media-add-ons/writer/MediaWriter.cpp   |  58 ++++-----
.../media/media-add-ons/writer/MediaWriter.h     |   3 +
.../media-add-ons/writer/MediaWriterAddOn.cpp    |  32 ++---
.../media-add-ons/writer/MediaWriterAddOn.h      |   3 +
src/add-ons/media/media-add-ons/writer/misc.cpp  | 129 -------------------
src/add-ons/media/media-add-ons/writer/misc.h    |  30 -----

----------------------------------------------------------------------------

diff --git a/src/add-ons/media/media-add-ons/Jamfile 
b/src/add-ons/media/media-add-ons/Jamfile
index ea59bbf..1a8c6d8 100644
--- a/src/add-ons/media/media-add-ons/Jamfile
+++ b/src/add-ons/media/media-add-ons/Jamfile
@@ -1,8 +1,8 @@
 SubDir HAIKU_TOP src add-ons media media-add-ons ;
 
 # SubInclude HAIKU_TOP src add-ons media media-add-ons demultiplexer ;
-# SubInclude HAIKU_TOP src add-ons media media-add-ons writer ;
 SubInclude HAIKU_TOP src add-ons media media-add-ons dvb ;
+SubInclude HAIKU_TOP src add-ons media media-add-ons equalizer ;
 SubInclude HAIKU_TOP src add-ons media media-add-ons esound_sink ;
 SubInclude HAIKU_TOP src add-ons media media-add-ons firewire_dv ;
 SubInclude HAIKU_TOP src add-ons media media-add-ons legacy ;
@@ -17,6 +17,5 @@ SubInclude HAIKU_TOP src add-ons media media-add-ons 
usb_webcam ;
 SubInclude HAIKU_TOP src add-ons media media-add-ons video_producer_demo ;
 SubInclude HAIKU_TOP src add-ons media media-add-ons videowindow ;
 SubInclude HAIKU_TOP src add-ons media media-add-ons video_mixer ;
-SubInclude HAIKU_TOP src add-ons media media-add-ons equalizer ;
 SubInclude HAIKU_TOP src add-ons media media-add-ons vst_host ;
-
+SubInclude HAIKU_TOP src add-ons media media-add-ons writer ;
diff --git a/src/add-ons/media/media-add-ons/reader/misc.cpp 
b/src/add-ons/media/media-add-ons/misc.cpp
similarity index 98%
rename from src/add-ons/media/media-add-ons/reader/misc.cpp
rename to src/add-ons/media/media-add-ons/misc.cpp
index 037ba0b..5fecef6 100644
--- a/src/add-ons/media/media-add-ons/reader/misc.cpp
+++ b/src/add-ons/media/media-add-ons/misc.cpp
@@ -25,7 +25,8 @@ void print_multistream_format(media_multistream_format * 
format) {
        }
        fprintf(stderr," avg_bit_rate(%f) max_bit_rate(%f)",
                        format->avg_bit_rate,format->max_bit_rate);
-       fprintf(stderr," avg_chunk_size(%i) max_chunk_size(%i)",
+       fprintf(stderr," avg_chunk_size(%" B_PRId32
+                       ") max_chunk_size(%"  B_PRId32 ")",
                        format->avg_chunk_size,format->max_chunk_size);
 }      
        
diff --git a/src/add-ons/media/media-add-ons/reader/misc.h 
b/src/add-ons/media/media-add-ons/misc.h
similarity index 100%
rename from src/add-ons/media/media-add-ons/reader/misc.h
rename to src/add-ons/media/media-add-ons/misc.h
diff --git a/src/add-ons/media/media-add-ons/reader/Jamfile 
b/src/add-ons/media/media-add-ons/reader/Jamfile
index 5b186fe..6574945 100644
--- a/src/add-ons/media/media-add-ons/reader/Jamfile
+++ b/src/add-ons/media/media-add-ons/reader/Jamfile
@@ -8,11 +8,11 @@ local architectureObject ;
 for architectureObject in [ MultiArchSubDirSetup ] {
        on $(architectureObject) {
                Application [ MultiArchDefaultGristFiles reader.media_addon ] :
-                       AbstractFileInterfaceNode.cpp
-                       AbstractFileInterfaceAddOn.cpp
+                       ../AbstractFileInterfaceNode.cpp
+                       ../AbstractFileInterfaceAddOn.cpp
                        MediaReader.cpp
                        MediaReaderAddOn.cpp
-                       misc.cpp
+                       ../misc.cpp
                        : be media [ TargetLibsupc++ ]
                ;
        }
diff --git a/src/add-ons/media/media-add-ons/reader/MediaReader.cpp 
b/src/add-ons/media/media-add-ons/reader/MediaReader.cpp
index eac40fd..3fde8d5 100644
--- a/src/add-ons/media/media-add-ons/reader/MediaReader.cpp
+++ b/src/add-ons/media/media-add-ons/reader/MediaReader.cpp
@@ -472,7 +472,7 @@ void MediaReader::Connect(
        FindLatencyFor(output.destination, &fDownstreamLatency, &id);
 
        // compute the buffer period (must be done before setbuffergroup)
-       fBufferPeriod = bigtime_t(1000 * 8000000 / 1024
+       fBufferPeriod = bigtime_t(1000u * 8000000u / 1024u
                             * output.format.u.multistream.max_chunk_size
                                     / 
output.format.u.multistream.max_bit_rate);
 
@@ -645,7 +645,7 @@ void MediaReader::AdditionalBufferRequested(                
        //      used to be Reserved 0
                        PRINT("MediaReader::AdditionalBufferRequested got an 
error from GetFilledBuffer.\n");
                        return; // don't send the buffer
                }
-               SendBuffer(buffer,output.destination);
+               SendBuffer(buffer, output.source, output.destination);
        }
 }
 
@@ -689,7 +689,7 @@ status_t MediaReader::HandleBuffer(
                        buffer->Recycle();
                } else {
                        if (fOutputEnabled) {
-                               status = SendBuffer(buffer,output.destination);
+                               status = SendBuffer(buffer, output.source, 
output.destination);
                                if (status != B_OK) {
                                        PRINT("MediaReader::HandleEvent got an 
error from SendBuffer.\n");
                                        buffer->Recycle();
diff --git a/src/add-ons/media/media-add-ons/reader/MediaReader.h 
b/src/add-ons/media/media-add-ons/reader/MediaReader.h
index d33caf3..a270676 100644
--- a/src/add-ons/media/media-add-ons/reader/MediaReader.h
+++ b/src/add-ons/media/media-add-ons/reader/MediaReader.h
@@ -66,6 +66,9 @@ virtual               void NodeRegistered(void);      /* 
reserved 2 */
 /*****************************/
 /* begin from BFileInterface */
 protected:
+
+using AbstractFileInterfaceNode::SetRef;
+
 virtual        status_t SetRef(
                                const entry_ref & file,
                                bool create,
diff --git a/src/add-ons/media/media-add-ons/reader/MediaReaderAddOn.h 
b/src/add-ons/media/media-add-ons/reader/MediaReaderAddOn.h
index a855edb..86a2082 100644
--- a/src/add-ons/media/media-add-ons/reader/MediaReaderAddOn.h
+++ b/src/add-ons/media/media-add-ons/reader/MediaReaderAddOn.h
@@ -45,6 +45,9 @@ virtual       status_t GetFileFormatList(
                                int32 in_read_items,            //      this 
many slots in out_readable_formats
                                int32 * out_read_items,         //      set 
this to actual # available, even if bigger than in count
                                void * _reserved);                      //      
ignore until further notice
+
+using AbstractFileInterfaceAddOn::SniffTypeKind;
+
 virtual        status_t SniffTypeKind(                         //      Like 
SniffType, but for the specific kind(s)
                                const BMimeType & type,
                                uint64 in_kinds,
diff --git a/src/add-ons/media/media-add-ons/writer/Jamfile 
b/src/add-ons/media/media-add-ons/writer/Jamfile
index 11e004a..05c1d00 100644
--- a/src/add-ons/media/media-add-ons/writer/Jamfile
+++ b/src/add-ons/media/media-add-ons/writer/Jamfile
@@ -2,17 +2,18 @@ SubDir HAIKU_TOP src add-ons media media-add-ons writer ;
 
 UsePrivateHeaders media ;
 
+SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons media media-add-ons ] ;
+
 local architectureObject ;
 for architectureObject in [ MultiArchSubDirSetup ] {
        on $(architectureObject) {
-               Addon [ MultiArchDefaultGristFiles writer.media_addon ] :
+               Application [ MultiArchDefaultGristFiles writer.media_addon ] :
                        ../AbstractFileInterfaceNode.cpp
                        ../AbstractFileInterfaceAddOn.cpp
                        MediaWriter.cpp
                        MediaWriterAddOn.cpp
-                       misc.cpp
-                       : be media
-                       : true
+                       ../misc.cpp
+                       : be media [ TargetLibsupc++ ]
                ;
        }
 }
diff --git a/src/add-ons/media/media-add-ons/writer/MediaWriter.cpp 
b/src/add-ons/media/media-add-ons/writer/MediaWriter.cpp
index 98a5bc7..0d0c13e 100644
--- a/src/add-ons/media/media-add-ons/writer/MediaWriter.cpp
+++ b/src/add-ons/media/media-add-ons/writer/MediaWriter.cpp
@@ -28,7 +28,7 @@
 
 #include "../AbstractFileInterfaceNode.h"
 #include "MediaWriter.h"
-#include "misc.h"
+#include "../misc.h"
 
 #include <stdio.h>
 #include <string.h>
@@ -48,14 +48,14 @@ MediaWriter::~MediaWriter(void)
 }
 
 MediaWriter::MediaWriter(
-                               size_t defaultChunkSize = 8192,
-                               float defaultBitRate = 800000,
-                               const flavor_info * info = 0,
-                               BMessage * config = 0,
-                               BMediaAddOn * addOn = 0)
+                               size_t defaultChunkSize,
+                               float defaultBitRate,
+                               const flavor_info * info,
+                               BMessage * config,
+                               BMediaAddOn * addOn)
        : BMediaNode("MediaWriter"),
-         
AbstractFileInterfaceNode(defaultChunkSize,defaultBitRate,info,config,addOn),
-         BBufferConsumer(B_MEDIA_MULTISTREAM)
+         BBufferConsumer(B_MEDIA_MULTISTREAM),
+         
AbstractFileInterfaceNode(defaultChunkSize,defaultBitRate,info,config,addOn)
 {
        fprintf(stderr,"MediaWriter::MediaWriter\n");
        // null some fields
@@ -459,7 +459,7 @@ status_t MediaWriter::SeekTagRequested(
 status_t MediaWriter::HandleBuffer(
                                const media_timed_event *event,
                                bigtime_t lateness,
-                               bool realTimeEvent = false)
+                               bool realTimeEvent)
 {
        fprintf(stderr,"MediaWriter::HandleBuffer\n");
        BBuffer * buffer = const_cast<BBuffer*>((BBuffer*)event->pointer);
@@ -479,7 +479,7 @@ status_t MediaWriter::HandleBuffer(
 status_t MediaWriter::HandleDataStatus(
                                                const media_timed_event *event,
                                                bigtime_t lateness,
-                                               bool realTimeEvent = false)
+                                               bool realTimeEvents)
 {
        fprintf(stderr,"MediaWriter::HandleDataStatus");
        // we have no where to send a data status to.
@@ -500,8 +500,8 @@ void MediaWriter::GetFlavor(flavor_info * outInfo, int32 id)
                return;
        }
        AbstractFileInterfaceNode::GetFlavor(outInfo,id);
-       outInfo->name = "OpenBeOS Media Writer";
-       outInfo->info = "The OpenBeOS Media Writer consumes a multistream and 
writes a file.";
+       strcpy(outInfo->name, "OpenBeOS Media Writer");
+       strcpy(outInfo->info, "The OpenBeOS Media Writer consumes a multistream 
and writes a file.");
        outInfo->kinds |= B_BUFFER_CONSUMER;
        outInfo->in_format_count = 1; // 1 input
        media_format * formats = new media_format[outInfo->in_format_count];
@@ -541,7 +541,7 @@ status_t MediaWriter::WriteFileBuffer(
                fprintf(stderr,"<- B_NO_INIT\n");
                return B_NO_INIT;
        }
-       fprintf(stderr,"  writing %i bytes at %i\n",
+       fprintf(stderr,"  writing %" B_PRId32 " bytes at %lld\n",
                        buffer->SizeUsed(),GetCurrentFile()->Position());
        ssize_t bytesWriten = 
GetCurrentFile()->Write(buffer->Data(),buffer->SizeUsed());
        if (bytesWriten < 0) {
@@ -556,19 +556,19 @@ status_t MediaWriter::WriteFileBuffer(
 // stuffing
 // -------------------------------------------------------- //
 
-status_t MediaWriter::_Reserved_MediaWriter_0(void *) {}
-status_t MediaWriter::_Reserved_MediaWriter_1(void *) {}
-status_t MediaWriter::_Reserved_MediaWriter_2(void *) {}
-status_t MediaWriter::_Reserved_MediaWriter_3(void *) {}
-status_t MediaWriter::_Reserved_MediaWriter_4(void *) {}
-status_t MediaWriter::_Reserved_MediaWriter_5(void *) {}
-status_t MediaWriter::_Reserved_MediaWriter_6(void *) {}
-status_t MediaWriter::_Reserved_MediaWriter_7(void *) {}
-status_t MediaWriter::_Reserved_MediaWriter_8(void *) {}
-status_t MediaWriter::_Reserved_MediaWriter_9(void *) {}
-status_t MediaWriter::_Reserved_MediaWriter_10(void *) {}
-status_t MediaWriter::_Reserved_MediaWriter_11(void *) {}
-status_t MediaWriter::_Reserved_MediaWriter_12(void *) {}
-status_t MediaWriter::_Reserved_MediaWriter_13(void *) {}
-status_t MediaWriter::_Reserved_MediaWriter_14(void *) {}
-status_t MediaWriter::_Reserved_MediaWriter_15(void *) {}
+status_t MediaWriter::_Reserved_MediaWriter_0(void *) { return B_ERROR; }
+status_t MediaWriter::_Reserved_MediaWriter_1(void *) { return B_ERROR; }
+status_t MediaWriter::_Reserved_MediaWriter_2(void *) { return B_ERROR; }
+status_t MediaWriter::_Reserved_MediaWriter_3(void *) { return B_ERROR; }
+status_t MediaWriter::_Reserved_MediaWriter_4(void *) { return B_ERROR; }
+status_t MediaWriter::_Reserved_MediaWriter_5(void *) { return B_ERROR; }
+status_t MediaWriter::_Reserved_MediaWriter_6(void *) { return B_ERROR; }
+status_t MediaWriter::_Reserved_MediaWriter_7(void *) { return B_ERROR; }
+status_t MediaWriter::_Reserved_MediaWriter_8(void *) { return B_ERROR; }
+status_t MediaWriter::_Reserved_MediaWriter_9(void *) { return B_ERROR; }
+status_t MediaWriter::_Reserved_MediaWriter_10(void *) { return B_ERROR; }
+status_t MediaWriter::_Reserved_MediaWriter_11(void *) { return B_ERROR; }
+status_t MediaWriter::_Reserved_MediaWriter_12(void *) { return B_ERROR; }
+status_t MediaWriter::_Reserved_MediaWriter_13(void *) { return B_ERROR; }
+status_t MediaWriter::_Reserved_MediaWriter_14(void *) { return B_ERROR; }
+status_t MediaWriter::_Reserved_MediaWriter_15(void *) { return B_ERROR; }
diff --git a/src/add-ons/media/media-add-ons/writer/MediaWriter.h 
b/src/add-ons/media/media-add-ons/writer/MediaWriter.h
index a391416..5ccb616 100644
--- a/src/add-ons/media/media-add-ons/writer/MediaWriter.h
+++ b/src/add-ons/media/media-add-ons/writer/MediaWriter.h
@@ -66,6 +66,9 @@ virtual               void NodeRegistered(void);      /* 
reserved 2 */
 /*****************************/
 /* begin from BFileInterface */
 protected:
+
+using AbstractFileInterfaceNode::SetRef;
+
 virtual        status_t SetRef(
                                const entry_ref & file,
                                bool create,
diff --git a/src/add-ons/media/media-add-ons/writer/MediaWriterAddOn.cpp 
b/src/add-ons/media/media-add-ons/writer/MediaWriterAddOn.cpp
index dc2f513..9003384 100644
--- a/src/add-ons/media/media-add-ons/writer/MediaWriterAddOn.cpp
+++ b/src/add-ons/media/media-add-ons/writer/MediaWriterAddOn.cpp
@@ -149,19 +149,19 @@ int main(int argc, char *argv[])
 // stuffing
 // -------------------------------------------------------- //
 
-status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_0(void *) {};
-status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_1(void *) {};
-status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_2(void *) {};
-status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_3(void *) {};
-status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_4(void *) {};
-status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_5(void *) {};
-status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_6(void *) {};
-status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_7(void *) {};
-status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_8(void *) {};
-status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_9(void *) {};
-status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_10(void *) {};
-status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_11(void *) {};
-status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_12(void *) {};
-status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_13(void *) {};
-status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_14(void *) {};
-status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_15(void *) {};
+status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_0(void *) { return 
B_ERROR; };
+status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_1(void *) { return 
B_ERROR; };
+status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_2(void *) { return 
B_ERROR; };
+status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_3(void *) { return 
B_ERROR; };
+status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_4(void *) { return 
B_ERROR; };
+status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_5(void *) { return 
B_ERROR; };
+status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_6(void *) { return 
B_ERROR; };
+status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_7(void *) { return 
B_ERROR; };
+status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_8(void *) { return 
B_ERROR; };
+status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_9(void *) { return 
B_ERROR; };
+status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_10(void *) { return 
B_ERROR; };
+status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_11(void *) { return 
B_ERROR; };
+status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_12(void *) { return 
B_ERROR; };
+status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_13(void *) { return 
B_ERROR; };
+status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_14(void *) { return 
B_ERROR; };
+status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_15(void *) { return 
B_ERROR; };
diff --git a/src/add-ons/media/media-add-ons/writer/MediaWriterAddOn.h 
b/src/add-ons/media/media-add-ons/writer/MediaWriterAddOn.h
index e5e61d7..e6c421e 100644
--- a/src/add-ons/media/media-add-ons/writer/MediaWriterAddOn.h
+++ b/src/add-ons/media/media-add-ons/writer/MediaWriterAddOn.h
@@ -45,6 +45,9 @@ virtual       status_t GetFileFormatList(
                                int32 in_read_items,            //      this 
many slots in out_readable_formats
                                int32 * out_read_items,         //      set 
this to actual # available, even if bigger than in count
                                void * _reserved);                      //      
ignore until further notice
+
+using AbstractFileInterfaceAddOn::SniffTypeKind;
+
 virtual        status_t SniffTypeKind(                         //      Like 
SniffType, but for the specific kind(s)
                                const BMimeType & type,
                                uint64 in_kinds,
diff --git a/src/add-ons/media/media-add-ons/writer/misc.cpp 
b/src/add-ons/media/media-add-ons/writer/misc.cpp
deleted file mode 100644
index 037ba0b..0000000
--- a/src/add-ons/media/media-add-ons/writer/misc.cpp
+++ /dev/null
@@ -1,129 +0,0 @@
-// misc.cpp
-//
-// Andrew Bachmann, 2002
-//
-// Some functions for general debugging and
-// working around be media kit bugs.
-
-#include "misc.h"
-#include <stdio.h>
-
-// -------------------------------------------------------- //
-// lib functions
-// -------------------------------------------------------- //
-
-void print_multistream_format(media_multistream_format * format) {
-       fprintf(stderr,"[");
-       switch (format->format) {
-       case media_multistream_format::B_ANY:                   
fprintf(stderr,"ANY"); break;
-       case media_multistream_format::B_VID:                   
fprintf(stderr,"VID"); break;
-       case media_multistream_format::B_AVI:                   
fprintf(stderr,"AVI"); break;
-       case media_multistream_format::B_MPEG1:         
fprintf(stderr,"MPEG1"); break;
-       case media_multistream_format::B_MPEG2:         
fprintf(stderr,"MPEG2"); break;
-       case media_multistream_format::B_QUICKTIME:     
fprintf(stderr,"QUICKTIME"); break;
-       default:                        fprintf(stderr,"????"); break;
-       }
-       fprintf(stderr," avg_bit_rate(%f) max_bit_rate(%f)",
-                       format->avg_bit_rate,format->max_bit_rate);
-       fprintf(stderr," avg_chunk_size(%i) max_chunk_size(%i)",
-                       format->avg_chunk_size,format->max_chunk_size);
-}      
-       
-void print_media_format(media_format * format) {
-       fprintf(stderr,"{");
-       switch (format->type) {
-       case B_MEDIA_NO_TYPE:           fprintf(stderr,"NO_TYPE"); break;       
        
-       case B_MEDIA_UNKNOWN_TYPE:      fprintf(stderr,"UNKNOWN_TYPE"); break;
-       case B_MEDIA_RAW_AUDIO:         fprintf(stderr,"RAW_AUDIO"); break;
-       case B_MEDIA_RAW_VIDEO:         fprintf(stderr,"RAW_VIDEO"); break;
-       case B_MEDIA_VBL:                       fprintf(stderr,"VBL"); break;
-       case B_MEDIA_TIMECODE:          fprintf(stderr,"TIMECODE"); break;
-       case B_MEDIA_MIDI:                      fprintf(stderr,"MIDI"); break;
-       case B_MEDIA_TEXT:                      fprintf(stderr,"TEXT"); break;
-       case B_MEDIA_HTML:                      fprintf(stderr,"HTML"); break;
-       case B_MEDIA_MULTISTREAM:       fprintf(stderr,"MULTISTREAM"); break;
-       case B_MEDIA_PARAMETERS:        fprintf(stderr,"PARAMETERS"); break;
-       case B_MEDIA_ENCODED_AUDIO:     fprintf(stderr,"ENCODED_AUDIO"); break;
-       case B_MEDIA_ENCODED_VIDEO:     fprintf(stderr,"ENCODED_VIDEO"); break;
-       default:                                        fprintf(stderr,"????"); 
break;
-       }
-       fprintf(stderr,":");
-       switch (format->type) {
-       case B_MEDIA_RAW_AUDIO:         fprintf(stderr,"RAW_AUDIO"); break;
-       case B_MEDIA_RAW_VIDEO:         fprintf(stderr,"RAW_VIDEO"); break;
-       case B_MEDIA_MULTISTREAM:       
print_multistream_format(&format->u.multistream); break;
-       case B_MEDIA_ENCODED_AUDIO:     fprintf(stderr,"ENCODED_AUDIO"); break;
-       case B_MEDIA_ENCODED_VIDEO:     fprintf(stderr,"ENCODED_VIDEO"); break;
-       default:                                        fprintf(stderr,"????"); 
break;
-       }
-       fprintf(stderr,"}");
-}
-
-bool multistream_format_is_acceptible(
-                                               const media_multistream_format 
& producer_format,
-                                               const media_multistream_format 
& consumer_format)
-{
-       // first check the format, if necessary
-       if (consumer_format.format != media_multistream_format::B_ANY) {
-               if (consumer_format.format != producer_format.format) {
-                       return false;
-               }
-       }
-       // then check the average bit rate
-       if (consumer_format.avg_bit_rate != 
media_multistream_format::wildcard.avg_bit_rate) {
-               if (consumer_format.avg_bit_rate != 
producer_format.avg_bit_rate) {
-                       // do they have to match exactly?  I don't know.  
assume yes.
-                       return false;
-               }
-       }
-       // then check the maximum bit rate
-       if (consumer_format.max_bit_rate != 
media_multistream_format::wildcard.max_bit_rate) {
-               if (consumer_format.max_bit_rate != 
producer_format.max_bit_rate) {
-                       // do they have to match exactly?  I don't know.  
assume yes.
-                       return false;
-               }
-       }
-       // then check the average chunk size
-       if (consumer_format.avg_chunk_size != 
media_multistream_format::wildcard.avg_chunk_size) {
-               if (consumer_format.avg_chunk_size != 
producer_format.avg_chunk_size) {
-                       // do they have to match exactly?  I don't know.  
assume yes.
-                       return false;
-               }
-       }
-       // then check the maximum bit rate
-       if (consumer_format.max_chunk_size != 
media_multistream_format::wildcard.max_chunk_size) {
-               if (consumer_format.max_chunk_size != 
producer_format.max_chunk_size) {
-                       // do they have to match exactly?  I don't know.  
assume yes.
-                       return false;
-               }
-       }
-       // should also check format specific fields, and others?
-       return true;
-}                                              
-
-bool format_is_acceptible(
-                                               const media_format & 
producer_format,
-                                               const media_format & 
consumer_format)
-{
-       // first check the type, if necessary
-       if (consumer_format.type != B_MEDIA_UNKNOWN_TYPE) {
-               if (consumer_format.type != producer_format.type) {
-                       return false;
-               }
-               switch (consumer_format.type) {
-                       case B_MEDIA_MULTISTREAM:
-                               if 
(!multistream_format_is_acceptible(producer_format.u.multistream,
-                                                                               
                          consumer_format.u.multistream)) {
-                                       return false;
-                               }
-                               break;
-                       default:
-                               fprintf(stderr,"format_is_acceptible : 
unimplemented type.\n");
-                               return 
format_is_compatible(producer_format,consumer_format);
-                               break;
-               }
-       }
-       // should also check non-type fields?
-       return true;
-}
-
diff --git a/src/add-ons/media/media-add-ons/writer/misc.h 
b/src/add-ons/media/media-add-ons/writer/misc.h
deleted file mode 100644
index 621730c..0000000
--- a/src/add-ons/media/media-add-ons/writer/misc.h
+++ /dev/null
@@ -1,30 +0,0 @@
-// misc.h
-//
-// Andrew Bachmann, 2002
-//
-// Some functions for general debugging and
-// working around be media kit bugs.
-
-#if !defined(_MISC_H)
-#define _MISC_H
-
-#include <MediaDefs.h>
-
-// -------------------------------------------------------- //
-// lib functions
-// -------------------------------------------------------- //
-
-void print_multistream_format(media_multistream_format * format);
-       
-void print_media_format(media_format * format);
-
-bool multistream_format_is_acceptible(
-                                               const media_multistream_format 
& producer_format,
-                                               const media_multistream_format 
& consumer_format);
-
-bool format_is_acceptible(
-                                               const media_format & 
producer_format,
-                                               const media_format & 
consumer_format);
-
-#endif // _MISC_H
-


Other related posts:

  • » [haiku-commits] haiku: hrev50082 - in src/add-ons/media/media-add-ons: writer reader . - b . vitruvio