Skip to content

Commit

Permalink
fix bug intel#833
Browse files Browse the repository at this point in the history
  • Loading branch information
wangzj0601 authored and xuguangxin committed Jul 2, 2018
1 parent 0067a64 commit fbcbdf3
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
5 changes: 3 additions & 2 deletions codecparsers/mpeg2_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
// config.h defines macros for log.h to define log levels
#include "common/log.h"
#include "mpeg2_parser.h"
#include <inttypes.h>

namespace YamiParser {
namespace MPEG2 {
Expand Down Expand Up @@ -255,7 +256,7 @@ namespace MPEG2 {
return false;


DEBUG("slice header size : %ld",
DEBUG("slice header size : %" PRIu64 "",
m_slice.sliceHeaderSize);
DEBUG("slice number : %x",
m_slice.verticalPosition);
Expand All @@ -269,7 +270,7 @@ namespace MPEG2 {
m_slice.intra_slice);
DEBUG("extra_bit_slice : %x",
m_slice.extra_bit_slice);
DEBUG("slice size : %ld",
DEBUG("slice size : %" PRIu64 "",
m_slice.sliceDataSize);
DEBUG("size left on buffer : %d", nalSize);
DEBUG("slice data : %p",
Expand Down
7 changes: 4 additions & 3 deletions decoder/vaapidecoder_mpeg2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "vaapidecoder_mpeg2.h"

#include <string.h>
#include <inttypes.h>

using YamiParser::MPEG2::Slice;
using YamiParser::MPEG2::PictureCodingExtension;
Expand Down Expand Up @@ -134,7 +135,7 @@ VaapiDecoderMPEG2::DPB::insertPictureToReferences(const PicturePtr& picture)

YamiStatus VaapiDecoderMPEG2::DPB::insertPicture(const PicturePtr& picture)
{
INFO("insertPicture to DPB size %lu", m_referencePictures.size());
INFO("insertPicture to DPB size %zu", m_referencePictures.size());

YamiStatus status = YAMI_SUCCESS;

Expand Down Expand Up @@ -172,7 +173,7 @@ YamiStatus VaapiDecoderMPEG2::DPB::insertPicture(const PicturePtr& picture)
}
}

DEBUG("insertPicture returns dpb size %lu", m_referencePictures.size());
DEBUG("insertPicture returns dpb size %zu", m_referencePictures.size());
return status;
}

Expand Down Expand Up @@ -887,7 +888,7 @@ YamiStatus VaapiDecoderMPEG2::decode(VideoDecodeBuffer* buffer)
m_stream->time_stamp = buffer->timeStamp;
m_currentPTS = buffer->timeStamp;

DEBUG("decode size %ld timeStamp %ld", m_stream->streamSize,
DEBUG("decode size %ld timeStamp %" PRIu64 "", m_stream->streamSize,
m_stream->time_stamp);

if (m_stream->streamSize < YamiParser::MPEG2::kStartCodeSize) {
Expand Down
3 changes: 2 additions & 1 deletion decoder/vaapidecoder_vp8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <string.h>
#include "common/log.h"
#include "vaapidecoder_vp8.h"
#include <inttypes.h>

using ::YamiParser::Vp8Parser;
using ::YamiParser::Vp8FrameHeader;
Expand Down Expand Up @@ -495,7 +496,7 @@ YamiStatus VaapiDecoderVP8::decode(VideoDecodeBuffer* buffer)
m_buffer = buffer->data;
m_frameSize = buffer->size;

DEBUG("VP8: Decode(bufsize =%d, timestamp=%ld)", m_frameSize,
DEBUG("VP8: Decode(bufsize =%d, timestamp=%" PRIu64 ")", m_frameSize,
m_currentPTS);

do {
Expand Down
14 changes: 7 additions & 7 deletions v4l2/v4l2_decode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ class ExternalBufferOutput : public V4l2Decoder::Output, BaseSurfaceAllocator {
m_count = count;
if (!count) {
for (size_t i = 0; i < m_surfaces.size(); i++) {
if (m_surfaces[i] != VA_INVALID_SURFACE) {
if (m_surfaces[i] != (intptr_t)VA_INVALID_SURFACE) {
destorySurface(m_surfaces[i]);
}
}
Expand Down Expand Up @@ -569,7 +569,7 @@ class ExternalDmaBufOutput : public ExternalBufferOutput {
//not really right, but we use sizeimage to deliver offset
external.offsets[i] = format.plane_fmt[i].sizeimage;
}
external.buffers = &buf->m.userptr;
external.buffers = (uintptr_t *)&buf->m.userptr;
external.num_buffers = 1;

return createExternalSurface(surface, rtFormat, external);
Expand Down Expand Up @@ -954,7 +954,7 @@ int32_t V4l2Decoder::onQueueBuffer(v4l2_buffer* buf)
CHECK(buf);
uint32_t type = buf->type;
CHECK(type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
|| type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);
|| type == (unsigned int)V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);

if (type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
CHECK(buf->memory == V4L2_MEMORY_MMAP);
Expand Down Expand Up @@ -984,7 +984,7 @@ int32_t V4l2Decoder::onDequeBuffer(v4l2_buffer* buf)
CHECK(buf);
uint32_t type = buf->type;
CHECK(type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
|| type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);
|| type == (unsigned int)V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);
if (type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
CHECK(m_inputOn);
uint32_t index;
Expand All @@ -1005,7 +1005,7 @@ int32_t V4l2Decoder::onDequeBuffer(v4l2_buffer* buf)
int32_t V4l2Decoder::onStreamOn(uint32_t type)
{
CHECK(type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
|| type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);
|| type == (unsigned int)V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);

if (type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {

Expand Down Expand Up @@ -1037,7 +1037,7 @@ void V4l2Decoder::flushDecoderJob()
int32_t V4l2Decoder::onStreamOff(uint32_t type)
{
CHECK(type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
|| type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);
|| type == (unsigned int)V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);
if (type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
if (m_inputOn) {
post(bind(&V4l2Decoder::flushDecoderJob, this));
Expand Down Expand Up @@ -1083,7 +1083,7 @@ int32_t V4l2Decoder::onRequestBuffers(const v4l2_requestbuffers* req)
uint32_t type = req->type;
uint32_t count = req->count;
CHECK(type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE
|| type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE);
|| type == (unsigned int)V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE);
if (type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
CHECK(req->memory == V4L2_MEMORY_MMAP);
return sendTask(bind(&V4l2Decoder::requestInputBuffers, this, count));
Expand Down
3 changes: 2 additions & 1 deletion vaapi/vaapidisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "common/log.h"
#include "common/lock.h"
#include "vaapi/VaapiUtils.h"
#include <inttypes.h>

using std::list;
/**
Expand Down Expand Up @@ -304,7 +305,7 @@ DisplayPtr DisplayCache::createDisplay(const NativeDisplay& nativeDisplay)
vaapiDisplay.reset();

//crate new one
DEBUG("nativeDisplay: (type : %d), (handle : %ld)", nativeDisplay.type, nativeDisplay.handle);
DEBUG("nativeDisplay: (type : %d), (handle : %" PRIxPTR ")", nativeDisplay.type, nativeDisplay.handle);

switch (nativeDisplay.type) {
case NATIVE_DISPLAY_AUTO:
Expand Down

0 comments on commit fbcbdf3

Please sign in to comment.