Skip to content
This repository has been archived by the owner on Jul 30, 2022. It is now read-only.

Commit

Permalink
use non-deprecated libvpx interface
Browse files Browse the repository at this point in the history
Some extremely old types were deleted w/libvpx-v1.0.0-187-g2bf8fb5
(contained in v1.1.0).

Change-Id: I6b43e1d580cb038b449d45931b67129b1b512e6b
  • Loading branch information
jzern committed Jun 22, 2012
1 parent c7f5163 commit 2733469
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
3 changes: 2 additions & 1 deletion grabcompressandsend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
extern "C"
{
#include "rtp.h"
#define VPX_CODEC_DISABLE_COMPAT 1
#include "vpx/vpx_encoder.h"
#include "vpx/vp8cx.h"
}
Expand Down Expand Up @@ -988,7 +989,7 @@ int main(int argc, char *argv[])
#endif

vpx_codec_ctx_t encoder;
vpx_img_alloc(&raw, IMG_FMT_YV12, display_width, display_height, 1);
vpx_img_alloc(&raw, VPX_IMG_FMT_YV12, display_width, display_height, 1);

cfg.rc_target_bitrate = video_bitrate;

Expand Down
17 changes: 9 additions & 8 deletions receivedecompressandplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
extern "C"
{
#include "rtp.h"
#define VPX_CODEC_DISABLE_COMPAT 1
#include "vpx/vpx_decoder.h"
#include "vpx/vp8dx.h"
}
Expand Down Expand Up @@ -348,20 +349,20 @@ int show_frame(vpx_image_t *img)
SDL_LockYUVOverlay(overlay);
int i;

unsigned char *in = img->planes[PLANE_Y];
unsigned char *in = img->planes[VPX_PLANE_Y];
unsigned char *p = (unsigned char *) overlay->pixels[0];

for (i = 0; i < display_height; i++, in += img->stride[PLANE_Y], p += display_width)
for (i = 0; i < display_height; i++, in += img->stride[VPX_PLANE_Y], p += display_width)
memcpy(p, in, display_width);

in = img->planes[PLANE_U];
in = img->planes[VPX_PLANE_U];

for (i = 0; i < display_height / 2; i++, in += img->stride[PLANE_U], p += display_width / 2)
for (i = 0; i < display_height / 2; i++, in += img->stride[VPX_PLANE_U], p += display_width / 2)
memcpy(p, in, display_width / 2);

in = img->planes[PLANE_V];
in = img->planes[VPX_PLANE_V];

for (i = 0; i < display_height / 2; i++, in += img->stride[PLANE_U], p += display_width / 2)
for (i = 0; i < display_height / 2; i++, in += img->stride[VPX_PLANE_U], p += display_width / 2)
memcpy(p, in, display_width / 2);

SDL_UnlockYUVOverlay(overlay);
Expand Down Expand Up @@ -1173,7 +1174,7 @@ int main(int argc, char *argv[])

int responded = 0;

vpx_dec_ctx_t decoder;
vpx_codec_ctx_t decoder;
uint8_t *buf = NULL;
vp8_postproc_cfg_t ppcfg;
vpx_codec_dec_cfg_t cfg = {0};
Expand Down Expand Up @@ -1289,7 +1290,7 @@ int main(int argc, char *argv[])
time_of_first_display = get_time();
}

vpx_dec_iter_t iter = NULL;
vpx_codec_iter_t iter = NULL;
vpx_image_t *img;

if (vpx_codec_decode(&decoder, compressed_video_buffer, sizeof(compressed_video_buffer), 0, 0))
Expand Down

0 comments on commit 2733469

Please sign in to comment.