media_reader/media_writer: Fix build
This commit is contained in:
parent
b1d006d7f8
commit
44200efd5d
@ -1,8 +1,8 @@
|
|||||||
SubDir HAIKU_TOP src add-ons media media-add-ons ;
|
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 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 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 esound_sink ;
|
||||||
SubInclude HAIKU_TOP src add-ons media media-add-ons firewire_dv ;
|
SubInclude HAIKU_TOP src add-ons media media-add-ons firewire_dv ;
|
||||||
SubInclude HAIKU_TOP src add-ons media media-add-ons legacy ;
|
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 video_producer_demo ;
|
||||||
SubInclude HAIKU_TOP src add-ons media media-add-ons videowindow ;
|
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 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 vst_host ;
|
||||||
|
SubInclude HAIKU_TOP src add-ons media media-add-ons writer ;
|
||||||
|
@ -25,7 +25,8 @@ void print_multistream_format(media_multistream_format * format) {
|
|||||||
}
|
}
|
||||||
fprintf(stderr," avg_bit_rate(%f) max_bit_rate(%f)",
|
fprintf(stderr," avg_bit_rate(%f) max_bit_rate(%f)",
|
||||||
format->avg_bit_rate,format->max_bit_rate);
|
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);
|
format->avg_chunk_size,format->max_chunk_size);
|
||||||
}
|
}
|
||||||
|
|
@ -8,11 +8,11 @@ local architectureObject ;
|
|||||||
for architectureObject in [ MultiArchSubDirSetup ] {
|
for architectureObject in [ MultiArchSubDirSetup ] {
|
||||||
on $(architectureObject) {
|
on $(architectureObject) {
|
||||||
Application [ MultiArchDefaultGristFiles reader.media_addon ] :
|
Application [ MultiArchDefaultGristFiles reader.media_addon ] :
|
||||||
AbstractFileInterfaceNode.cpp
|
../AbstractFileInterfaceNode.cpp
|
||||||
AbstractFileInterfaceAddOn.cpp
|
../AbstractFileInterfaceAddOn.cpp
|
||||||
MediaReader.cpp
|
MediaReader.cpp
|
||||||
MediaReaderAddOn.cpp
|
MediaReaderAddOn.cpp
|
||||||
misc.cpp
|
../misc.cpp
|
||||||
: be media [ TargetLibsupc++ ]
|
: be media [ TargetLibsupc++ ]
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
@ -472,7 +472,7 @@ void MediaReader::Connect(
|
|||||||
FindLatencyFor(output.destination, &fDownstreamLatency, &id);
|
FindLatencyFor(output.destination, &fDownstreamLatency, &id);
|
||||||
|
|
||||||
// compute the buffer period (must be done before setbuffergroup)
|
// 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_chunk_size
|
||||||
/ output.format.u.multistream.max_bit_rate);
|
/ 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");
|
PRINT("MediaReader::AdditionalBufferRequested got an error from GetFilledBuffer.\n");
|
||||||
return; // don't send the buffer
|
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();
|
buffer->Recycle();
|
||||||
} else {
|
} else {
|
||||||
if (fOutputEnabled) {
|
if (fOutputEnabled) {
|
||||||
status = SendBuffer(buffer,output.destination);
|
status = SendBuffer(buffer, output.source, output.destination);
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
PRINT("MediaReader::HandleEvent got an error from SendBuffer.\n");
|
PRINT("MediaReader::HandleEvent got an error from SendBuffer.\n");
|
||||||
buffer->Recycle();
|
buffer->Recycle();
|
||||||
|
@ -66,6 +66,9 @@ virtual void NodeRegistered(void); /* reserved 2 */
|
|||||||
/*****************************/
|
/*****************************/
|
||||||
/* begin from BFileInterface */
|
/* begin from BFileInterface */
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
using AbstractFileInterfaceNode::SetRef;
|
||||||
|
|
||||||
virtual status_t SetRef(
|
virtual status_t SetRef(
|
||||||
const entry_ref & file,
|
const entry_ref & file,
|
||||||
bool create,
|
bool create,
|
||||||
|
@ -45,6 +45,9 @@ virtual status_t GetFileFormatList(
|
|||||||
int32 in_read_items, // this many slots in out_readable_formats
|
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
|
int32 * out_read_items, // set this to actual # available, even if bigger than in count
|
||||||
void * _reserved); // ignore until further notice
|
void * _reserved); // ignore until further notice
|
||||||
|
|
||||||
|
using AbstractFileInterfaceAddOn::SniffTypeKind;
|
||||||
|
|
||||||
virtual status_t SniffTypeKind( // Like SniffType, but for the specific kind(s)
|
virtual status_t SniffTypeKind( // Like SniffType, but for the specific kind(s)
|
||||||
const BMimeType & type,
|
const BMimeType & type,
|
||||||
uint64 in_kinds,
|
uint64 in_kinds,
|
||||||
|
@ -2,17 +2,18 @@ SubDir HAIKU_TOP src add-ons media media-add-ons writer ;
|
|||||||
|
|
||||||
UsePrivateHeaders media ;
|
UsePrivateHeaders media ;
|
||||||
|
|
||||||
|
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons media media-add-ons ] ;
|
||||||
|
|
||||||
local architectureObject ;
|
local architectureObject ;
|
||||||
for architectureObject in [ MultiArchSubDirSetup ] {
|
for architectureObject in [ MultiArchSubDirSetup ] {
|
||||||
on $(architectureObject) {
|
on $(architectureObject) {
|
||||||
Addon [ MultiArchDefaultGristFiles writer.media_addon ] :
|
Application [ MultiArchDefaultGristFiles writer.media_addon ] :
|
||||||
../AbstractFileInterfaceNode.cpp
|
../AbstractFileInterfaceNode.cpp
|
||||||
../AbstractFileInterfaceAddOn.cpp
|
../AbstractFileInterfaceAddOn.cpp
|
||||||
MediaWriter.cpp
|
MediaWriter.cpp
|
||||||
MediaWriterAddOn.cpp
|
MediaWriterAddOn.cpp
|
||||||
misc.cpp
|
../misc.cpp
|
||||||
: be media
|
: be media [ TargetLibsupc++ ]
|
||||||
: true
|
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
#include "../AbstractFileInterfaceNode.h"
|
#include "../AbstractFileInterfaceNode.h"
|
||||||
#include "MediaWriter.h"
|
#include "MediaWriter.h"
|
||||||
#include "misc.h"
|
#include "../misc.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -48,14 +48,14 @@ MediaWriter::~MediaWriter(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
MediaWriter::MediaWriter(
|
MediaWriter::MediaWriter(
|
||||||
size_t defaultChunkSize = 8192,
|
size_t defaultChunkSize,
|
||||||
float defaultBitRate = 800000,
|
float defaultBitRate,
|
||||||
const flavor_info * info = 0,
|
const flavor_info * info,
|
||||||
BMessage * config = 0,
|
BMessage * config,
|
||||||
BMediaAddOn * addOn = 0)
|
BMediaAddOn * addOn)
|
||||||
: BMediaNode("MediaWriter"),
|
: 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");
|
fprintf(stderr,"MediaWriter::MediaWriter\n");
|
||||||
// null some fields
|
// null some fields
|
||||||
@ -459,7 +459,7 @@ status_t MediaWriter::SeekTagRequested(
|
|||||||
status_t MediaWriter::HandleBuffer(
|
status_t MediaWriter::HandleBuffer(
|
||||||
const media_timed_event *event,
|
const media_timed_event *event,
|
||||||
bigtime_t lateness,
|
bigtime_t lateness,
|
||||||
bool realTimeEvent = false)
|
bool realTimeEvent)
|
||||||
{
|
{
|
||||||
fprintf(stderr,"MediaWriter::HandleBuffer\n");
|
fprintf(stderr,"MediaWriter::HandleBuffer\n");
|
||||||
BBuffer * buffer = const_cast<BBuffer*>((BBuffer*)event->pointer);
|
BBuffer * buffer = const_cast<BBuffer*>((BBuffer*)event->pointer);
|
||||||
@ -479,7 +479,7 @@ status_t MediaWriter::HandleBuffer(
|
|||||||
status_t MediaWriter::HandleDataStatus(
|
status_t MediaWriter::HandleDataStatus(
|
||||||
const media_timed_event *event,
|
const media_timed_event *event,
|
||||||
bigtime_t lateness,
|
bigtime_t lateness,
|
||||||
bool realTimeEvent = false)
|
bool realTimeEvents)
|
||||||
{
|
{
|
||||||
fprintf(stderr,"MediaWriter::HandleDataStatus");
|
fprintf(stderr,"MediaWriter::HandleDataStatus");
|
||||||
// we have no where to send a data status to.
|
// we have no where to send a data status to.
|
||||||
@ -500,8 +500,8 @@ void MediaWriter::GetFlavor(flavor_info * outInfo, int32 id)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
AbstractFileInterfaceNode::GetFlavor(outInfo,id);
|
AbstractFileInterfaceNode::GetFlavor(outInfo,id);
|
||||||
outInfo->name = "OpenBeOS Media Writer";
|
strcpy(outInfo->name, "OpenBeOS Media Writer");
|
||||||
outInfo->info = "The OpenBeOS Media Writer consumes a multistream and writes a file.";
|
strcpy(outInfo->info, "The OpenBeOS Media Writer consumes a multistream and writes a file.");
|
||||||
outInfo->kinds |= B_BUFFER_CONSUMER;
|
outInfo->kinds |= B_BUFFER_CONSUMER;
|
||||||
outInfo->in_format_count = 1; // 1 input
|
outInfo->in_format_count = 1; // 1 input
|
||||||
media_format * formats = new media_format[outInfo->in_format_count];
|
media_format * formats = new media_format[outInfo->in_format_count];
|
||||||
@ -541,7 +541,7 @@ status_t MediaWriter::WriteFileBuffer(
|
|||||||
fprintf(stderr,"<- B_NO_INIT\n");
|
fprintf(stderr,"<- B_NO_INIT\n");
|
||||||
return B_NO_INIT;
|
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());
|
buffer->SizeUsed(),GetCurrentFile()->Position());
|
||||||
ssize_t bytesWriten = GetCurrentFile()->Write(buffer->Data(),buffer->SizeUsed());
|
ssize_t bytesWriten = GetCurrentFile()->Write(buffer->Data(),buffer->SizeUsed());
|
||||||
if (bytesWriten < 0) {
|
if (bytesWriten < 0) {
|
||||||
@ -556,19 +556,19 @@ status_t MediaWriter::WriteFileBuffer(
|
|||||||
// stuffing
|
// stuffing
|
||||||
// -------------------------------------------------------- //
|
// -------------------------------------------------------- //
|
||||||
|
|
||||||
status_t MediaWriter::_Reserved_MediaWriter_0(void *) {}
|
status_t MediaWriter::_Reserved_MediaWriter_0(void *) { return B_ERROR; }
|
||||||
status_t MediaWriter::_Reserved_MediaWriter_1(void *) {}
|
status_t MediaWriter::_Reserved_MediaWriter_1(void *) { return B_ERROR; }
|
||||||
status_t MediaWriter::_Reserved_MediaWriter_2(void *) {}
|
status_t MediaWriter::_Reserved_MediaWriter_2(void *) { return B_ERROR; }
|
||||||
status_t MediaWriter::_Reserved_MediaWriter_3(void *) {}
|
status_t MediaWriter::_Reserved_MediaWriter_3(void *) { return B_ERROR; }
|
||||||
status_t MediaWriter::_Reserved_MediaWriter_4(void *) {}
|
status_t MediaWriter::_Reserved_MediaWriter_4(void *) { return B_ERROR; }
|
||||||
status_t MediaWriter::_Reserved_MediaWriter_5(void *) {}
|
status_t MediaWriter::_Reserved_MediaWriter_5(void *) { return B_ERROR; }
|
||||||
status_t MediaWriter::_Reserved_MediaWriter_6(void *) {}
|
status_t MediaWriter::_Reserved_MediaWriter_6(void *) { return B_ERROR; }
|
||||||
status_t MediaWriter::_Reserved_MediaWriter_7(void *) {}
|
status_t MediaWriter::_Reserved_MediaWriter_7(void *) { return B_ERROR; }
|
||||||
status_t MediaWriter::_Reserved_MediaWriter_8(void *) {}
|
status_t MediaWriter::_Reserved_MediaWriter_8(void *) { return B_ERROR; }
|
||||||
status_t MediaWriter::_Reserved_MediaWriter_9(void *) {}
|
status_t MediaWriter::_Reserved_MediaWriter_9(void *) { return B_ERROR; }
|
||||||
status_t MediaWriter::_Reserved_MediaWriter_10(void *) {}
|
status_t MediaWriter::_Reserved_MediaWriter_10(void *) { return B_ERROR; }
|
||||||
status_t MediaWriter::_Reserved_MediaWriter_11(void *) {}
|
status_t MediaWriter::_Reserved_MediaWriter_11(void *) { return B_ERROR; }
|
||||||
status_t MediaWriter::_Reserved_MediaWriter_12(void *) {}
|
status_t MediaWriter::_Reserved_MediaWriter_12(void *) { return B_ERROR; }
|
||||||
status_t MediaWriter::_Reserved_MediaWriter_13(void *) {}
|
status_t MediaWriter::_Reserved_MediaWriter_13(void *) { return B_ERROR; }
|
||||||
status_t MediaWriter::_Reserved_MediaWriter_14(void *) {}
|
status_t MediaWriter::_Reserved_MediaWriter_14(void *) { return B_ERROR; }
|
||||||
status_t MediaWriter::_Reserved_MediaWriter_15(void *) {}
|
status_t MediaWriter::_Reserved_MediaWriter_15(void *) { return B_ERROR; }
|
||||||
|
@ -66,6 +66,9 @@ virtual void NodeRegistered(void); /* reserved 2 */
|
|||||||
/*****************************/
|
/*****************************/
|
||||||
/* begin from BFileInterface */
|
/* begin from BFileInterface */
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
using AbstractFileInterfaceNode::SetRef;
|
||||||
|
|
||||||
virtual status_t SetRef(
|
virtual status_t SetRef(
|
||||||
const entry_ref & file,
|
const entry_ref & file,
|
||||||
bool create,
|
bool create,
|
||||||
|
@ -149,19 +149,19 @@ int main(int argc, char *argv[])
|
|||||||
// stuffing
|
// stuffing
|
||||||
// -------------------------------------------------------- //
|
// -------------------------------------------------------- //
|
||||||
|
|
||||||
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_0(void *) {};
|
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_0(void *) { return B_ERROR; };
|
||||||
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_1(void *) {};
|
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_1(void *) { return B_ERROR; };
|
||||||
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_2(void *) {};
|
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_2(void *) { return B_ERROR; };
|
||||||
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_3(void *) {};
|
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_3(void *) { return B_ERROR; };
|
||||||
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_4(void *) {};
|
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_4(void *) { return B_ERROR; };
|
||||||
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_5(void *) {};
|
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_5(void *) { return B_ERROR; };
|
||||||
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_6(void *) {};
|
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_6(void *) { return B_ERROR; };
|
||||||
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_7(void *) {};
|
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_7(void *) { return B_ERROR; };
|
||||||
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_8(void *) {};
|
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_8(void *) { return B_ERROR; };
|
||||||
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_9(void *) {};
|
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_9(void *) { return B_ERROR; };
|
||||||
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_10(void *) {};
|
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_10(void *) { return B_ERROR; };
|
||||||
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_11(void *) {};
|
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_11(void *) { return B_ERROR; };
|
||||||
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_12(void *) {};
|
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_12(void *) { return B_ERROR; };
|
||||||
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_13(void *) {};
|
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_13(void *) { return B_ERROR; };
|
||||||
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_14(void *) {};
|
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_14(void *) { return B_ERROR; };
|
||||||
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_15(void *) {};
|
status_t MediaWriterAddOn::_Reserved_MediaWriterAddOn_15(void *) { return B_ERROR; };
|
||||||
|
@ -45,6 +45,9 @@ virtual status_t GetFileFormatList(
|
|||||||
int32 in_read_items, // this many slots in out_readable_formats
|
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
|
int32 * out_read_items, // set this to actual # available, even if bigger than in count
|
||||||
void * _reserved); // ignore until further notice
|
void * _reserved); // ignore until further notice
|
||||||
|
|
||||||
|
using AbstractFileInterfaceAddOn::SniffTypeKind;
|
||||||
|
|
||||||
virtual status_t SniffTypeKind( // Like SniffType, but for the specific kind(s)
|
virtual status_t SniffTypeKind( // Like SniffType, but for the specific kind(s)
|
||||||
const BMimeType & type,
|
const BMimeType & type,
|
||||||
uint64 in_kinds,
|
uint64 in_kinds,
|
||||||
|
@ -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;
|
|
||||||
}
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user