Style cleanup, switched "* " style.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31997 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,8 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
** Copyright 2004, the OpenBeOS project. All rights reserved.
|
* Copyright 2004-2009, The Haiku Project. All rights reserved.
|
||||||
** Distributed under the terms of the OpenBeOS License.
|
* Distributed under the terms of the MIT license.
|
||||||
**
|
*
|
||||||
** Authors: Axel Dörfler, Marcus Overhagen
|
* Authors:
|
||||||
|
* Axel Dörfler
|
||||||
|
* Marcus Overhagen
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -77,7 +79,8 @@ _media_format_description::~_media_format_description()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_media_format_description::_media_format_description(const _media_format_description & other)
|
_media_format_description::_media_format_description(
|
||||||
|
const _media_format_description& other)
|
||||||
{
|
{
|
||||||
memcpy(this, &other, sizeof(*this));
|
memcpy(this, &other, sizeof(*this));
|
||||||
}
|
}
|
||||||
@@ -92,7 +95,8 @@ _media_format_description::operator=(const _media_format_description & other)
|
|||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
operator==(const media_format_description & a, const media_format_description & b)
|
operator==(const media_format_description& a,
|
||||||
|
const media_format_description& b)
|
||||||
{
|
{
|
||||||
if (a.family != b.family)
|
if (a.family != b.family)
|
||||||
return false;
|
return false;
|
||||||
@@ -101,7 +105,8 @@ operator==(const media_format_description & a, const media_format_description &
|
|||||||
case B_BEOS_FORMAT_FAMILY:
|
case B_BEOS_FORMAT_FAMILY:
|
||||||
return a.u.beos.format == b.u.beos.format;
|
return a.u.beos.format == b.u.beos.format;
|
||||||
case B_QUICKTIME_FORMAT_FAMILY:
|
case B_QUICKTIME_FORMAT_FAMILY:
|
||||||
return a.u.quicktime.codec == b.u.quicktime.codec && a.u.quicktime.vendor == b.u.quicktime.vendor;
|
return a.u.quicktime.codec == b.u.quicktime.codec
|
||||||
|
&& a.u.quicktime.vendor == b.u.quicktime.vendor;
|
||||||
case B_AVI_FORMAT_FAMILY:
|
case B_AVI_FORMAT_FAMILY:
|
||||||
return a.u.avi.codec == b.u.avi.codec;
|
return a.u.avi.codec == b.u.avi.codec;
|
||||||
case B_ASF_FORMAT_FAMILY:
|
case B_ASF_FORMAT_FAMILY:
|
||||||
@@ -115,7 +120,8 @@ operator==(const media_format_description & a, const media_format_description &
|
|||||||
case B_AVR_FORMAT_FAMILY:
|
case B_AVR_FORMAT_FAMILY:
|
||||||
return a.u.avr.id == b.u.avr.id;
|
return a.u.avr.id == b.u.avr.id;
|
||||||
case B_MISC_FORMAT_FAMILY:
|
case B_MISC_FORMAT_FAMILY:
|
||||||
return a.u.misc.file_format == b.u.misc.file_format && a.u.misc.codec == b.u.misc.codec;
|
return a.u.misc.file_format == b.u.misc.file_format
|
||||||
|
&& a.u.misc.codec == b.u.misc.codec;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
@@ -195,6 +201,7 @@ meta_format::meta_format(const media_format_description &description,
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
meta_format::meta_format(const media_format_description& description)
|
meta_format::meta_format(const media_format_description& description)
|
||||||
:
|
:
|
||||||
description(description),
|
description(description),
|
||||||
@@ -212,7 +219,8 @@ meta_format::meta_format(const meta_format &other)
|
|||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
meta_format::Matches(const media_format &otherFormat, media_format_family family)
|
meta_format::Matches(const media_format& otherFormat,
|
||||||
|
media_format_family family)
|
||||||
{
|
{
|
||||||
if (family != description.family)
|
if (family != description.family)
|
||||||
return false;
|
return false;
|
||||||
@@ -264,7 +272,8 @@ update_media_formats()
|
|||||||
BMessage reply;
|
BMessage reply;
|
||||||
status_t status = QueryServer(request, reply);
|
status_t status = QueryServer(request, reply);
|
||||||
if (status < B_OK) {
|
if (status < B_OK) {
|
||||||
ERROR("BMediaFormats: Could not update formats: %s\n", strerror(status));
|
ERROR("BMediaFormats: Could not update formats: %s\n",
|
||||||
|
strerror(status));
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -464,7 +473,7 @@ status_t
|
|||||||
BMediaFormats::RewindFormats()
|
BMediaFormats::RewindFormats()
|
||||||
{
|
{
|
||||||
if (!sLock.IsLocked() || sLock.LockingThread() != find_thread(NULL)) {
|
if (!sLock.IsLocked() || sLock.LockingThread() != find_thread(NULL)) {
|
||||||
// ToDo: shouldn't we simply drop into the debugger in this case?
|
// TODO: Shouldn't we simply drop into the debugger in this case?
|
||||||
return B_NOT_ALLOWED;
|
return B_NOT_ALLOWED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -478,13 +487,13 @@ BMediaFormats::GetNextFormat(media_format *_format,
|
|||||||
media_format_description* _description)
|
media_format_description* _description)
|
||||||
{
|
{
|
||||||
if (!sLock.IsLocked() || sLock.LockingThread() != find_thread(NULL)) {
|
if (!sLock.IsLocked() || sLock.LockingThread() != find_thread(NULL)) {
|
||||||
// ToDo: shouldn't we simply drop into the debugger in this case?
|
// TODO: Shouldn't we simply drop into the debugger in this case?
|
||||||
return B_NOT_ALLOWED;
|
return B_NOT_ALLOWED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fIteratorIndex == 0) {
|
if (fIteratorIndex == 0) {
|
||||||
// this is the first call, so let's make sure we have
|
// This is the first call, so let's make sure we have current data to
|
||||||
// current data to operate on
|
// operate on.
|
||||||
status_t status = update_media_formats();
|
status_t status = update_media_formats();
|
||||||
if (status < B_OK)
|
if (status < B_OK)
|
||||||
return status;
|
return status;
|
||||||
@@ -514,11 +523,13 @@ BMediaFormats::Unlock()
|
|||||||
|
|
||||||
status_t
|
status_t
|
||||||
BMediaFormats::MakeFormatFor(const media_format_description* descriptions,
|
BMediaFormats::MakeFormatFor(const media_format_description* descriptions,
|
||||||
int32 descriptionCount, media_format *format, uint32 flags, void * _reserved)
|
int32 descriptionCount, media_format* format, uint32 flags,
|
||||||
|
void* _reserved)
|
||||||
{
|
{
|
||||||
BMessage request(MEDIA_SERVER_MAKE_FORMAT_FOR);
|
BMessage request(MEDIA_SERVER_MAKE_FORMAT_FOR);
|
||||||
for (int32 i = 0 ; i < descriptionCount ; i++) {
|
for (int32 i = 0 ; i < descriptionCount ; i++) {
|
||||||
request.AddData("description", B_RAW_TYPE, &descriptions[i], sizeof(descriptions[i]));
|
request.AddData("description", B_RAW_TYPE, &descriptions[i],
|
||||||
|
sizeof(descriptions[i]));
|
||||||
}
|
}
|
||||||
request.AddData("format", B_RAW_TYPE, format, sizeof(*format));
|
request.AddData("format", B_RAW_TYPE, format, sizeof(*format));
|
||||||
request.AddData("flags", B_UINT32_TYPE, &flags, sizeof(flags));
|
request.AddData("flags", B_UINT32_TYPE, &flags, sizeof(flags));
|
||||||
@@ -532,22 +543,18 @@ BMediaFormats::MakeFormatFor(const media_format_description *descriptions,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check the status
|
// check the status
|
||||||
if (reply.FindInt32("result", &status) < B_OK) {
|
if (reply.FindInt32("result", &status) < B_OK)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
if (status != B_OK)
|
||||||
if (status != B_OK) {
|
|
||||||
return status;
|
return status;
|
||||||
}
|
|
||||||
|
|
||||||
// get the format
|
// get the format
|
||||||
const void* data;
|
const void* data;
|
||||||
ssize_t size;
|
ssize_t size;
|
||||||
if (reply.FindData("format", B_RAW_TYPE, 0, &data, &size) != B_OK) {
|
if (reply.FindData("format", B_RAW_TYPE, 0, &data, &size) != B_OK)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
if (size != sizeof(*format))
|
||||||
if (size != sizeof(*format)) {
|
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
|
||||||
|
|
||||||
// copy the BMessage's data into our format
|
// copy the BMessage's data into our format
|
||||||
*format = *(media_format*)data;
|
*format = *(media_format*)data;
|
||||||
@@ -555,7 +562,9 @@ BMediaFormats::MakeFormatFor(const media_format_description *descriptions,
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --- begin deprecated API --- */
|
|
||||||
|
// #pragma mark - deprecated API
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BMediaFormats::MakeFormatFor(const media_format_description& description,
|
BMediaFormats::MakeFormatFor(const media_format_description& description,
|
||||||
|
|||||||
Reference in New Issue
Block a user