本文整理汇总了C++中CALLED函数的典型用法代码示例。如果您正苦于以下问题:C++ CALLED函数的具体用法?C++ CALLED怎么用?C++ CALLED使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CALLED函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CALLED
status_t
ESDSinkNode::SetBufferGroup(const media_source& for_source, BBufferGroup* newGroup)
{
CALLED();
node_output *channel = FindOutput(for_source);
// is this our output?
if (channel == NULL)
{
fprintf(stderr, "ESDSinkNode::SetBufferGroup returning B_MEDIA_BAD_SOURCE\n");
return B_MEDIA_BAD_SOURCE;
}
// Are we being passed the buffer group we're already using?
if (newGroup == channel->fBufferGroup) return B_OK;
// Ahh, someone wants us to use a different buffer group. At this point we delete
// the one we are using and use the specified one instead. If the specified group is
// NULL, we need to recreate one ourselves, and use *that*. Note that if we're
// caching a BBuffer that we requested earlier, we have to Recycle() that buffer
// *before* deleting the buffer group, otherwise we'll deadlock waiting for that
// buffer to be recycled!
delete channel->fBufferGroup; // waits for all buffers to recycle
if (newGroup != NULL)
{
// we were given a valid group; just use that one from now on
channel->fBufferGroup = newGroup;
}
else
{
// we were passed a NULL group pointer; that means we construct
// our own buffer group to use from now on
size_t size = channel->fOutput.format.u.raw_audio.buffer_size;
int32 count = int32(fLatency / BufferDuration() + 1 + 1);
channel->fBufferGroup = new BBufferGroup(size, count);
}
return B_OK;
}
示例2: CALLED
status_t
SoftPipeRenderer::CopyPixelsOut(BPoint location, BBitmap *bitmap)
{
CALLED();
color_space scs = fBitmap->ColorSpace();
color_space dcs = bitmap->ColorSpace();
if (scs != dcs && (scs != B_RGBA32 || dcs != B_RGB32)) {
fprintf(stderr, "%s::CopyPixelsOut(): incompatible color space: %s != %s\n",
__FUNCTION__, color_space_name(scs), color_space_name(dcs));
return B_BAD_TYPE;
}
BRect sr = fBitmap->Bounds();
BRect dr = bitmap->Bounds();
// int32 w1 = sr.IntegerWidth();
// int32 h1 = sr.IntegerHeight();
// int32 w2 = dr.IntegerWidth();
// int32 h2 = dr.IntegerHeight();
sr = sr & dr.OffsetBySelf(location);
dr = sr.OffsetByCopy(-location.x, -location.y);
uint8 *ps = (uint8 *) fBitmap->Bits();
uint8 *pd = (uint8 *) bitmap->Bits();
uint32 *s, *d;
uint32 y;
for (y = (uint32) sr.top; y <= (uint32) sr.bottom; y++) {
s = (uint32 *)(ps + y * fBitmap->BytesPerRow());
s += (uint32) sr.left;
d = (uint32 *)(pd + (y + (uint32)(dr.top - sr.top))
* bitmap->BytesPerRow());
d += (uint32) dr.left;
memcpy(d, s, dr.IntegerWidth() * 4);
}
return B_OK;
}
示例3: CALLED
void
BTimeSource::FinishCreate()
{
CALLED();
//printf("BTimeSource::FinishCreate(), id %ld\n", ID());
char name[32];
sprintf(name, "__timesource_buf_%" B_PRId32, ID());
fArea = create_area(name, reinterpret_cast<void **>(const_cast<BPrivate::media::TimeSourceTransmit **>(&fBuf)), B_ANY_ADDRESS, TS_AREA_SIZE, B_FULL_LOCK, B_READ_AREA | B_WRITE_AREA);
if (fArea <= 0) {
ERROR("BTimeSource::BTimeSource couldn't create area, node %" B_PRId32
"\n", ID());
fBuf = NULL;
return;
}
fBuf->readindex = 0;
fBuf->writeindex = 1;
fBuf->realtime[0] = 0;
fBuf->perftime[0] = 0;
fBuf->drift[0] = 1.0f;
fBuf->isrunning = fStarted;
}
示例4: CALLED
status_t
ESDEndpoint::SendDefaultCommand()
{
status_t err;
struct {
esd_format_t format;
esd_rate_t rate;
char name[ESD_MAX_NAME];
} c;
CALLED();
if (fDefaultCommandSent)
return EALREADY;
c.format = fDefaultFormat;
c.rate = fDefaultRate;
strcpy(c.name, "BeOS/Haiku/ZETA Media Kit output");
err = SendCommand(fDefaultCommand, (uint8 *)&c, sizeof(c), NULL, 0);
if (err < B_OK)
return err;
PRINT(("SendCommand: %s\n", strerror(err)));
fDefaultCommandSent = true;
return B_OK;
}
示例5: CALLED
status_t
FireWireDVNode::FormatProposal(const media_source& source,
media_format* format)
{
CALLED();
/* The connection process:
* we are here => BBufferProducer::FormatProposal
* BBufferConsumer::AcceptFormat
* BBufferProducer::PrepareToConnect
* BBufferConsumer::Connected
* BBufferProducer::Connect
*
* What we need to do:
* - if the format contains a wildcard AND we have a requirement for that
* field, set it to the value we need.
* - if a field has a value that is not wildcard and not supported by us,
* we don't change it, and return B_MEDIA_BAD_FORMAT
* - after we are done, the format may still contain wildcards.
*/
if (source.port != ControlPort()) {
fprintf(stderr, "FireWireDVNode::FormatProposal returning "
"B_MEDIA_BAD_SOURCE\n");
return B_MEDIA_BAD_SOURCE;
}
media_type requestedType = format->type;
*format = fDefaultFormatEncVideo;
if (requestedType != B_MEDIA_UNKNOWN_TYPE
&& requestedType != B_MEDIA_ENCODED_VIDEO) {
fprintf(stderr, "FireWireDVNode::FormatProposal returning "
"B_MEDIA_BAD_FORMAT\n");
return B_MEDIA_BAD_FORMAT;
}
// encoded video or wildcard type, either is okay by us
return B_OK;
}
示例6: CALLED
status_t
BMediaTrack::ReadChunk(char** _buffer, int32* _size, media_header* _header)
{
CALLED();
if (fExtractor == NULL)
return B_NO_INIT;
if (_buffer == NULL || _size == NULL)
return B_BAD_VALUE;
media_header header;
if (_header == NULL)
_header = &header;
// Always clear the header first, as the extractor may not set all fields.
memset(_header, 0, sizeof(media_header));
const void* buffer;
size_t size;
status_t result = fExtractor->GetNextChunk(fStream, &buffer, &size,
_header);
if (result == B_OK) {
*_buffer = const_cast<char*>(static_cast<const char*>(buffer));
// TODO: Change the pointer type when we break the API.
*_size = size;
// TODO: This changes the meaning of fCurrentTime from pointing
// to the next chunk start time (i.e. after seeking) to the start time
// of the last chunk. Asking the extractor for the current time will
// not work so well because of the chunk cache. But providing a
// "duration" field in the media_header could be useful.
fCurrentTime = _header->start_time;
fCurrentFrame = (int64)(fCurrentTime * _FrameRate() / 1000000LL);
}
return result;
}
示例7: Unregister
status_t
Unregister(const BMessenger& notifyHandler, const media_node& node,
int32 notification)
{
CALLED();
if (notification == B_MEDIA_SERVER_STARTED
|| notification == B_MEDIA_SERVER_QUIT) {
BMessage msg(MEDIA_ROSTER_CANCEL_NOTIFICATIONS);
msg.AddInt32(NOTIFICATION_PARAM_WHAT, notification);
msg.AddMessenger(NOTIFICATION_PARAM_MESSENGER, notifyHandler);
return BPrivate::media::dataexchange::SendToRoster(&msg);
}
BMessage msg(MEDIA_SERVER_CANCEL_NOTIFICATIONS);
msg.AddInt32(NOTIFICATION_PARAM_WHAT, notification);
msg.AddInt32(NOTIFICATION_PARAM_TEAM, BPrivate::current_team());
msg.AddMessenger(NOTIFICATION_PARAM_MESSENGER, notifyHandler);
msg.AddData("node", B_RAW_TYPE, &node, sizeof(node));
return BPrivate::media::dataexchange::SendToServer(&msg);
}
示例8: CALLED
status_t
BMediaTrack::FindKeyFrameForFrame(int64* _frame, int32 flags) const
{
CALLED();
if (fExtractor == NULL)
return B_NO_INIT;
if (_frame == NULL)
return B_BAD_VALUE;
// Make sure flags are valid
flags = (flags & B_MEDIA_SEEK_DIRECTION_MASK) | B_MEDIA_SEEK_TO_FRAME;
bigtime_t time = 0;
// dummy time, will be ignored because of flags
status_t result = fExtractor->FindKeyFrame(fStream, flags, _frame, &time);
if (result != B_OK) {
ERROR("BMediaTrack::FindKeyFrameForFrame: extractor seek failed: %s\n",
strerror(result));
}
return result;
}
示例9: CALLED
status_t MediaReader::HandleMessage(
int32 message,
const void * data,
size_t size)
{
CALLED();
status_t status = B_OK;
switch (message) {
// no special messages for now
default:
status = BBufferProducer::HandleMessage(message,data,size);
if (status == B_OK) {
break;
}
status = AbstractFileInterfaceNode::HandleMessage(message,data,size);
break;
}
return status;
}
示例10: CALLED
void
SoundPlayNode::NodeRegistered()
{
CALLED();
if (fInitStatus != B_OK) {
ReportError(B_NODE_IN_DISTRESS);
return;
}
SetPriority(B_URGENT_PRIORITY);
fOutput.format.type = B_MEDIA_RAW_AUDIO;
fOutput.format.u.raw_audio = media_multi_audio_format::wildcard;
fOutput.destination = media_destination::null;
fOutput.source.port = ControlPort();
fOutput.source.id = 0;
fOutput.node = Node();
strcpy(fOutput.name, Name());
Run();
}
示例11: CALLED
void
BMenuField::_InitMenuBar(BMenu* menu, BRect frame, bool fixedSize)
{
CALLED();
fMenu = menu;
InitMenu(menu);
if ((Flags() & B_SUPPORTS_LAYOUT)) {
fMenuBar = new _BMCMenuBar_(fixedSize, this);
} else {
frame.left = _MenuBarOffset();
frame.top = kVMargin;
frame.right -= kVMargin;
frame.bottom -= kVMargin;
TRACE("frame(%.1f, %.1f, %.1f, %.1f) (%.2f, %.2f)\n",
frame.left, frame.top, frame.right, frame.bottom,
frame.Width(), frame.Height());
fMenuBar = new _BMCMenuBar_(frame, fixedSize, this);
}
if (fixedSize) {
// align the menu bar in the full available space
fMenuBar->SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH,
B_ALIGN_VERTICAL_UNSET));
} else {
// align the menu bar left in the available space
fMenuBar->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
B_ALIGN_VERTICAL_UNSET));
}
AddChild(fMenuBar);
fMenuBar->AddItem(menu);
fMenuBar->SetFont(be_plain_font);
}
示例12: CALLED
status_t OpenSoundDeviceEngine::PreferredFormatFor(int fmt, media_format &format, bool rec)
{
status_t err;
CALLED();
fmt &= rec ? Info()->iformats : Info()->oformats;
if (fmt == 0)
return B_MEDIA_BAD_FORMAT;
err = WildcardFormatFor(fmt, format);
if (err < B_OK)
return err;
if (format.type == B_MEDIA_RAW_AUDIO) {
media_multi_audio_format &raw = format.u.raw_audio;
//format.u.raw_audio.channel_count = Info()->max_channels;
raw.byte_order = B_MEDIA_HOST_ENDIAN;
raw.frame_rate = OpenSoundDevice::convert_oss_rate_to_media_rate(Info()->max_rate); // measured in Hertz
raw.buffer_size = DEFAULT_BUFFER_SIZE;
/*if (rec)
raw.buffer_size = 2048;*/
/*
format.u.raw_audio.byte_order = B_MEDIA_HOST_ENDIAN;
format.u.raw_audio.frame_rate = OpenSoundDevice::convert_oss_rate_to_media_rate(Info()->max_rate); // measured in Hertz
format.u.raw_audio.buffer_size = DEFAULT_BUFFER_SIZE;
*/
} else if (format.type == B_MEDIA_ENCODED_AUDIO) {
media_raw_audio_format &raw = format.u.encoded_audio.output;
//format.u.encoded_audio.output.channel_count = Info()->max_channels;
raw.byte_order = B_MEDIA_HOST_ENDIAN;
// single rate supported
if (Info()->min_rate == Info()->max_rate)
raw.frame_rate = OpenSoundDevice::convert_oss_rate_to_media_rate(Info()->max_rate); // measured in Hertz
raw.buffer_size = DEFAULT_BUFFER_SIZE;
} else
return EINVAL;
char buf[1024];
string_for_format(format, buf, 1024);
PRINT(("%s: %s\n", __FUNCTION__, buf));
return B_OK;
}
示例13: BMediaIOWrapper
BMediaIOWrapper(BDataIO* source)
:
fData(NULL),
fPosition(NULL),
fMedia(NULL),
fFile(NULL),
fFallbackBuffer(NULL),
fErr(B_NO_ERROR)
{
CALLED();
fPosition = dynamic_cast<BPositionIO*>(source);
fMedia = dynamic_cast<BMediaIO*>(source);
fFile = dynamic_cast<BFile*>(source);
fData = source;
// No need to do additional buffering if we have
// a BBufferIO or a BMediaIO.
if (dynamic_cast<BBufferIO *>(source) == NULL) {
// Source needs to be at least a BPositionIO to wrap with a BBufferIO
if (IsSeekable()) {
fPosition = new(std::nothrow) BBufferIO(fPosition, 65536, true);
if (fPosition == NULL) {
fErr = B_NO_MEMORY;
return;
}
// We have to reset our BDataIO reference too
fData = dynamic_cast<BDataIO*>(fPosition);
} else {
// In this case we have to supply our own form
// of pseudo-seekable object from a non-seekable
// BDataIO.
fFallbackBuffer = new BMallocIO();
fFallbackBuffer->SetBlockSize(BLOCK_SIZE);
TRACE("Unable to improve performance with a BufferIO\n");
}
}
}
示例14: NS
static void
NS(test_main)(void *arg)
{
int expected, actual;
(void)arg;
NS_MOCK(tls_get_write_overhead_ratio);
NS_MOCK(we_are_hibernating);
NS_MOCK(public_server_mode);
NS_MOCK(get_uptime);
NS_MOCK(get_bytes_read);
NS_MOCK(get_bytes_written);
NS_MOCK(logv);
NS_MOCK(server_mode);
NS_MOCK(accounting_is_enabled);
log_global_min_severity_ = LOG_DEBUG;
stats_n_data_bytes_packaged = RELAY_PAYLOAD_SIZE;
stats_n_data_cells_packaged = 2;
expected = 0;
actual = log_heartbeat(0);
tt_int_op(actual, OP_EQ, expected);
tt_int_op(CALLED(logv), OP_EQ, 2);
done:
stats_n_data_bytes_packaged = 0;
stats_n_data_cells_packaged = 0;
NS_UNMOCK(tls_get_write_overhead_ratio);
NS_UNMOCK(we_are_hibernating);
NS_UNMOCK(public_server_mode);
NS_UNMOCK(get_uptime);
NS_UNMOCK(get_bytes_read);
NS_UNMOCK(get_bytes_written);
NS_UNMOCK(logv);
NS_UNMOCK(server_mode);
NS_UNMOCK(accounting_is_enabled);
}
示例15: init_haiku
EGLBoolean
init_haiku(_EGLDriver *drv, _EGLDisplay *disp)
{
_EGLDevice *dev;
CALLED();
dev = _eglAddDevice(-1, true);
if (!dev) {
_eglError(EGL_NOT_INITIALIZED, "DRI2: failed to find EGLDevice");
return EGL_FALSE;
}
disp->Device = dev;
TRACE("Add configs\n");
if (!haiku_add_configs_for_visuals(disp))
return EGL_FALSE;
disp->Version = 14;
TRACE("Initialization finished\n");
return EGL_TRUE;
}