本文整理汇总了C++中sp::debugString方法的典型用法代码示例。如果您正苦于以下问题:C++ sp::debugString方法的具体用法?C++ sp::debugString怎么用?C++ sp::debugString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sp
的用法示例。
在下文中一共展示了sp::debugString方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: postMessage_l
status_t ALooperRoster::postMessage_l(
const sp<AMessage> &msg, int64_t delayUs) {
ssize_t index = mHandlers.indexOfKey(msg->target());
if (index < 0) {
ALOGW("failed to post message '%s'. Target handler not registered.",
msg->debugString().c_str());
return -ENOENT;
}
const HandlerInfo &info = mHandlers.valueAt(index);
sp<ALooper> looper = info.mLooper.promote();
if (looper == NULL) {
ALOGW("failed to post message. "
"Target handler %d still registered, but object gone.",
msg->target());
mHandlers.removeItemsAt(index);
return -ENOENT;
}
looper->post(msg, delayUs);
return OK;
}
示例2: onMessageReceived
void AHierarchicalStateMachine::onMessageReceived(const sp<AMessage> &msg) {
sp<AState> save = mState;
sp<AState> cur = mState;
while (cur != NULL && !cur->onMessageReceived(msg)) {
// If you claim not to have handled the message you shouldn't
// have called setState...
CHECK(save == mState);
cur = cur->parentState();
}
if (cur != NULL) {
return;
}
ALOGW("Warning message %s unhandled in root state.",
msg->debugString().c_str());
}
示例3: ALOGV
void NuPlayer::DecoderPassThrough::onMessageReceived(const sp<AMessage> &msg) {
ALOGV("[%s] onMessage: %s", mComponentName.c_str(),
msg->debugString().c_str());
switch (msg->what()) {
case kWhatBufferConsumed:
{
if (!isStaleReply(msg)) {
int32_t size;
CHECK(msg->findInt32("size", &size));
onBufferConsumed(size);
}
break;
}
default:
DecoderBase::onMessageReceived(msg);
break;
}
}
示例4: onMessageReceived
void Converter::onMessageReceived(const sp<AMessage> &msg) {
switch (msg->what()) {
case kWhatMediaPullerNotify:
{
int32_t what;
CHECK(msg->findInt32("what", &what));
if (!mIsPCMAudio && mEncoder == NULL) {
ALOGV("got msg '%s' after encoder shutdown.",
msg->debugString().c_str());
if (what == MediaPuller::kWhatAccessUnit) {
sp<ABuffer> accessUnit;
CHECK(msg->findBuffer("accessUnit", &accessUnit));
accessUnit->setMediaBufferBase(NULL);
}
break;
}
if (what == MediaPuller::kWhatEOS) {
mInputBufferQueue.push_back(NULL);
feedEncoderInputBuffers();
scheduleDoMoreWork();
} else {
CHECK_EQ(what, MediaPuller::kWhatAccessUnit);
sp<ABuffer> accessUnit;
CHECK(msg->findBuffer("accessUnit", &accessUnit));
if (mNumFramesToDrop > 0 || mEncodingSuspended) {
if (mNumFramesToDrop > 0) {
--mNumFramesToDrop;
ALOGI("dropping frame.");
}
accessUnit->setMediaBufferBase(NULL);
break;
}
#if 0
MediaBuffer *mbuf =
(MediaBuffer *)(accessUnit->getMediaBufferBase());
if (mbuf != NULL) {
ALOGI("queueing mbuf %p", mbuf);
mbuf->release();
}
#endif
#if ENABLE_SILENCE_DETECTION
if (!mIsVideo) {
if (IsSilence(accessUnit)) {
if (mInSilentMode) {
break;
}
int64_t nowUs = ALooper::GetNowUs();
if (mFirstSilentFrameUs < 0ll) {
mFirstSilentFrameUs = nowUs;
} else if (nowUs >= mFirstSilentFrameUs + 10000000ll) {
mInSilentMode = true;
ALOGI("audio in silent mode now.");
break;
}
} else {
if (mInSilentMode) {
ALOGI("audio no longer in silent mode.");
}
mInSilentMode = false;
mFirstSilentFrameUs = -1ll;
}
}
#endif
mInputBufferQueue.push_back(accessUnit);
feedEncoderInputBuffers();
scheduleDoMoreWork();
}
break;
}
case kWhatEncoderActivity:
{
#if 0
int64_t whenUs;
if (msg->findInt64("whenUs", &whenUs)) {
int64_t nowUs = ALooper::GetNowUs();
ALOGI("[%s] kWhatEncoderActivity after %lld us",
mIsVideo ? "video" : "audio", nowUs - whenUs);
}
#endif
mDoMoreWorkPending = false;
if (mEncoder == NULL) {
//.........这里部分代码省略.........
示例5: onMessageReceived
void MediaFilter::onMessageReceived(const sp<AMessage> &msg) {
switch (msg->what()) {
case kWhatAllocateComponent:
{
onAllocateComponent(msg);
break;
}
case kWhatConfigureComponent:
{
onConfigureComponent(msg);
break;
}
case kWhatStart:
{
onStart();
break;
}
case kWhatProcessBuffers:
{
processBuffers();
break;
}
case kWhatInputBufferFilled:
{
onInputBufferFilled(msg);
break;
}
case kWhatOutputBufferDrained:
{
onOutputBufferDrained(msg);
break;
}
case kWhatShutdown:
{
onShutdown(msg);
break;
}
case kWhatFlush:
{
onFlush();
break;
}
case kWhatResume:
{
// nothing to do
break;
}
case kWhatSetParameters:
{
onSetParameters(msg);
break;
}
case kWhatCreateInputSurface:
{
onCreateInputSurface();
break;
}
case GraphicBufferListener::kWhatFrameAvailable:
{
onInputFrameAvailable();
break;
}
case kWhatSignalEndOfInputStream:
{
onSignalEndOfInputStream();
break;
}
default:
{
ALOGE("Message not handled:\n%s", msg->debugString().c_str());
break;
}
}
}
示例6: onMessageReceived
void Converter::onMessageReceived(const sp<AMessage> &msg) {
switch (msg->what()) {
case kWhatMediaPullerNotify:
{
int32_t what;
CHECK(msg->findInt32("what", &what));
if (!mIsPCMAudio && mEncoder == NULL) {
ALOGV("got msg '%s' after encoder shutdown.",
msg->debugString().c_str());
if (what == MediaPuller::kWhatAccessUnit) {
sp<ABuffer> accessUnit;
CHECK(msg->findBuffer("accessUnit", &accessUnit));
void *mbuf;
if (accessUnit->meta()->findPointer("mediaBuffer", &mbuf)
&& mbuf != NULL) {
ALOGV("releasing mbuf %p", mbuf);
accessUnit->meta()->setPointer("mediaBuffer", NULL);
static_cast<MediaBuffer *>(mbuf)->release();
mbuf = NULL;
}
}
break;
}
if (what == MediaPuller::kWhatEOS) {
mInputBufferQueue.push_back(NULL);
feedEncoderInputBuffers();
scheduleDoMoreWork();
} else {
CHECK_EQ(what, MediaPuller::kWhatAccessUnit);
sp<ABuffer> accessUnit;
CHECK(msg->findBuffer("accessUnit", &accessUnit));
#if 0
void *mbuf;
if (accessUnit->meta()->findPointer("mediaBuffer", &mbuf)
&& mbuf != NULL) {
ALOGI("queueing mbuf %p", mbuf);
}
#endif
#if ENABLE_SILENCE_DETECTION
if (!mIsVideo) {
if (IsSilence(accessUnit)) {
if (mInSilentMode) {
break;
}
int64_t nowUs = ALooper::GetNowUs();
if (mFirstSilentFrameUs < 0ll) {
mFirstSilentFrameUs = nowUs;
} else if (nowUs >= mFirstSilentFrameUs + 10000000ll) {
mInSilentMode = true;
ALOGI("audio in silent mode now.");
break;
}
} else {
if (mInSilentMode) {
ALOGI("audio no longer in silent mode.");
}
mInSilentMode = false;
mFirstSilentFrameUs = -1ll;
}
}
#endif
mInputBufferQueue.push_back(accessUnit);
feedEncoderInputBuffers();
scheduleDoMoreWork();
}
break;
}
case kWhatEncoderActivity:
{
#if 0
int64_t whenUs;
if (msg->findInt64("whenUs", &whenUs)) {
int64_t nowUs = ALooper::GetNowUs();
ALOGI("[%s] kWhatEncoderActivity after %lld us",
mIsVideo ? "video" : "audio", nowUs - whenUs);
}
#endif
mDoMoreWorkPending = false;
if (mEncoder == NULL) {
break;
}
//.........这里部分代码省略.........
示例7: setAudioFormat
status_t FFMPEGSoftCodec::setAudioFormat(
const sp<AMessage> &msg, const char* mime, sp<IOMX> OMXhandle,
IOMX::node_id nodeID, bool isEncoder ) {
ALOGV("setAudioFormat called");
status_t err = OK;
if (isEncoder) {
ALOGE("Encoding not supported");
err = BAD_VALUE;
} else if (!strcasecmp(MEDIA_MIMETYPE_AUDIO_WMA, mime)) {
err = setWMAFormat(msg, OMXhandle, nodeID);
if (err != OK) {
ALOGE("setWMAFormat() failed (err = %d)", err);
}
} else if (!strcasecmp(MEDIA_MIMETYPE_AUDIO_VORBIS, mime)) {
err = setVORBISFormat(msg, OMXhandle, nodeID);
if (err != OK) {
ALOGE("setVORBISFormat() failed (err = %d)", err);
}
} else if (!strcasecmp(MEDIA_MIMETYPE_AUDIO_RA, mime)) {
err = setRAFormat(msg, OMXhandle, nodeID);
if (err != OK) {
ALOGE("setRAFormat() failed (err = %d)", err);
}
} else if (!strcasecmp(MEDIA_MIMETYPE_AUDIO_FLAC, mime)) {
err = setFLACFormat(msg, OMXhandle, nodeID);
if (err != OK) {
ALOGE("setFLACFormat() failed (err = %d)", err);
}
} else if (!strcasecmp(MEDIA_MIMETYPE_AUDIO_MPEG_LAYER_II, mime)) {
err = setMP2Format(msg, OMXhandle, nodeID);
if (err != OK) {
ALOGE("setMP2Format() failed (err = %d)", err);
}
} else if (!strcasecmp(MEDIA_MIMETYPE_AUDIO_AC3, mime)) {
err = setAC3Format(msg, OMXhandle, nodeID);
if (err != OK) {
ALOGE("setAC3Format() failed (err = %d)", err);
}
} else if (!strcasecmp(MEDIA_MIMETYPE_AUDIO_APE, mime)) {
err = setAPEFormat(msg, OMXhandle, nodeID);
if (err != OK) {
ALOGE("setAPEFormat() failed (err = %d)", err);
}
} else if (!strcasecmp(MEDIA_MIMETYPE_AUDIO_DTS, mime)) {
err = setDTSFormat(msg, OMXhandle, nodeID);
if (err != OK) {
ALOGE("setDTSFormat() failed (err = %d)", err);
}
} else if (!strcasecmp(MEDIA_MIMETYPE_AUDIO_FFMPEG, mime)) {
err = setFFmpegAudioFormat(msg, OMXhandle, nodeID);
if (err != OK) {
ALOGE("setFFmpegAudioFormat() failed (err = %d)", err);
}
}
ALOGV("setAudioFormat: %s", msg->debugString(0).c_str());
return err;
}