MediaPlayer: fix reporting wrong format
Now it allows to connect MediaPlayer video producer to differnt node in Cortex. Change-Id: I7ee598ea64d10e8fa876259e7a4480a650a0e189 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3034 Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This commit is contained in:
parent
d9f74c873b
commit
f27269a67d
@ -357,14 +357,22 @@ VideoProducer::PrepareToConnect(const media_source& source,
|
||||
return B_MEDIA_BAD_FORMAT;
|
||||
}
|
||||
|
||||
if (format->u.raw_video.display.line_width == 0)
|
||||
format->u.raw_video.display.line_width = 384;
|
||||
if (format->u.raw_video.display.line_count == 0)
|
||||
format->u.raw_video.display.line_count = 288;
|
||||
if (format->u.raw_video.field_rate == 0)
|
||||
format->u.raw_video.field_rate = 25.0;
|
||||
if (format->u.raw_video.display.bytes_per_row == 0)
|
||||
format->u.raw_video.display.bytes_per_row = format->u.raw_video.display.line_width * 4;
|
||||
if (format->u.raw_video.display.line_width == 0) {
|
||||
format->u.raw_video.display.line_width
|
||||
= fSupplier->Format().u.raw_video.display.line_width;
|
||||
}
|
||||
if (format->u.raw_video.display.line_count == 0) {
|
||||
format->u.raw_video.display.line_count
|
||||
= fSupplier->Format().u.raw_video.display.line_count;
|
||||
}
|
||||
if (format->u.raw_video.field_rate == 0) {
|
||||
format->u.raw_video.field_rate
|
||||
= fSupplier->Format().u.raw_video.field_rate;
|
||||
}
|
||||
if (format->u.raw_video.display.bytes_per_row == 0) {
|
||||
format->u.raw_video.display.bytes_per_row
|
||||
= fSupplier->Format().u.raw_video.display.bytes_per_row;
|
||||
}
|
||||
|
||||
*outSource = fOutput.source;
|
||||
strcpy(outName, fOutput.name);
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
|
||||
#include <SupportDefs.h>
|
||||
#include <MediaFormats.h>
|
||||
|
||||
|
||||
struct media_raw_video_format;
|
||||
@ -18,6 +19,7 @@ public:
|
||||
VideoSupplier();
|
||||
virtual ~VideoSupplier();
|
||||
|
||||
virtual const media_format& Format() const = 0;
|
||||
virtual status_t FillBuffer(int64 startFrame, void* buffer,
|
||||
const media_raw_video_format& format,
|
||||
bool forceGeneration, bool& wasCached) = 0;
|
||||
|
@ -28,6 +28,13 @@ ProxyVideoSupplier::~ProxyVideoSupplier()
|
||||
}
|
||||
|
||||
|
||||
const media_format&
|
||||
ProxyVideoSupplier::Format() const
|
||||
{
|
||||
return fSupplier->Format();
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
ProxyVideoSupplier::FillBuffer(int64 startFrame, void* buffer,
|
||||
const media_raw_video_format& format, bool forceGeneration,
|
||||
|
@ -18,6 +18,7 @@ public:
|
||||
ProxyVideoSupplier();
|
||||
virtual ~ProxyVideoSupplier();
|
||||
|
||||
virtual const media_format& Format() const;
|
||||
virtual status_t FillBuffer(int64 startFrame, void* buffer,
|
||||
const media_raw_video_format& format,
|
||||
bool forceGeneration, bool& wasCached);
|
||||
|
Loading…
Reference in New Issue
Block a user