From: Gwenole Beauchesne Date: Tue, 31 Jul 2012 09:51:57 +0000 (+0200) Subject: jpeg: update to the latest VA-API changes (0.32.1+). X-Git-Tag: 0.4.0~78 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7c1b9b48e46f893b2c0c1848a65729840bda5281;p=platform%2Fupstream%2Fgstreamer-vaapi.git jpeg: update to the latest VA-API changes (0.32.1+). --- diff --git a/configure.ac b/configure.ac index f6b07d5..ebcf69b 100644 --- a/configure.ac +++ b/configure.ac @@ -380,7 +380,7 @@ if test $USE_GLX -eq 1; then fi AC_SUBST(LIBVA_GLX_PKGNAME) -dnl Check for JPEG decoding API (0.33+) +dnl Check for JPEG decoding API (0.32.1+) USE_JPEG_DECODER=0 AC_CACHE_CHECK([for JPEG decoding API], ac_cv_have_jpeg_decoding_api, [ @@ -390,12 +390,11 @@ AC_CACHE_CHECK([for JPEG decoding API], LIBS="$CFLAGS $LIBVA_LIBS" AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( - [[#include - #include ]], - [[VAPictureParameterBufferJPEG pic_param; - VASliceParameterBufferJPEG slice_param; - VAHuffmanTableBufferJPEG huffman_table; - VAIQMatrixBufferJPEG iq_matrix;]])], + [[#include ]], + [[VAPictureParameterBufferJPEGBaseline pic_param; + VASliceParameterBufferJPEGBaseline slice_param; + VAHuffmanTableBufferJPEGBaseline huffman_table; + VAIQMatrixBufferJPEGBaseline iq_matrix;]])], [ac_cv_have_jpeg_decoding_api="yes" USE_JPEG_DECODER=1], [ac_cv_have_jpeg_decoding_api="no"] ) diff --git a/gst-libs/gst/vaapi/gstvaapicodec_objects.h b/gst-libs/gst/vaapi/gstvaapicodec_objects.h index c70f34f..a064c15 100644 --- a/gst-libs/gst/vaapi/gstvaapicodec_objects.h +++ b/gst-libs/gst/vaapi/gstvaapicodec_objects.h @@ -390,9 +390,9 @@ prefix##_class_init(type##Class *klass) \ #define GST_VAAPI_BITPLANE_NEW(decoder, size) \ gst_vaapi_bitplane_new(GST_VAAPI_DECODER_CAST(decoder), NULL, size) - -#define GST_VAAPI_HUFFMAN_TABLE_NEW(codec, decoder) \ - gst_vaapi_huffman_table_new(GST_VAAPI_DECODER_CAST(decoder), \ + +#define GST_VAAPI_HUFFMAN_TABLE_NEW(codec, decoder) \ + gst_vaapi_huffman_table_new(GST_VAAPI_DECODER_CAST(decoder), \ NULL, sizeof(VAHuffmanTableBuffer##codec)) G_END_DECLS diff --git a/gst-libs/gst/vaapi/gstvaapicompat.h b/gst-libs/gst/vaapi/gstvaapicompat.h index 47cd7a3..4a1f93d 100644 --- a/gst-libs/gst/vaapi/gstvaapicompat.h +++ b/gst-libs/gst/vaapi/gstvaapicompat.h @@ -49,7 +49,6 @@ /* Compatibility glue with VA-API 0.34 */ #if VA_CHECK_VERSION(0,34,0) # include -# include #endif #endif /* GST_VAAPI_COMPAT_H */ diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c b/gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c index ac19b3d..5cfbe4d 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c @@ -173,18 +173,15 @@ fill_picture( GstJpegFrameHdr *jpeg_frame_hdr ) { - VAPictureParameterBufferJPEG *pic_param = picture->param; + VAPictureParameterBufferJPEGBaseline *pic_param = picture->param; guint i; g_assert(pic_param); - memset(pic_param, 0, sizeof(VAPictureParameterBufferJPEG)); - pic_param->sample_precision = jpeg_frame_hdr->sample_precision; + memset(pic_param, 0, sizeof(VAPictureParameterBufferJPEGBaseline)); pic_param->picture_width = jpeg_frame_hdr->width; pic_param->picture_height = jpeg_frame_hdr->height; - /* XXX: ROI + rotation */ - pic_param->num_components = jpeg_frame_hdr->num_components; if (jpeg_frame_hdr->num_components > 4) return FALSE; @@ -208,13 +205,13 @@ fill_quantization_table( ) { GstVaapiDecoderJpegPrivate * const priv = decoder->priv; - VAIQMatrixBufferJPEG *iq_matrix; + VAIQMatrixBufferJPEGBaseline *iq_matrix; guint i, j, num_tables; if (!priv->has_quant_table) gst_jpeg_get_default_quantization_tables(&priv->quant_tables); - picture->iq_matrix = GST_VAAPI_IQ_MATRIX_NEW(JPEG, decoder); + picture->iq_matrix = GST_VAAPI_IQ_MATRIX_NEW(JPEGBaseline, decoder); g_assert(picture->iq_matrix); iq_matrix = picture->iq_matrix->param; @@ -246,13 +243,13 @@ fill_huffman_table( { GstVaapiDecoderJpegPrivate * const priv = decoder->priv; GstJpegHuffmanTables * const huf_tables = &priv->huf_tables; - VAHuffmanTableBufferJPEG *huffman_table; + VAHuffmanTableBufferJPEGBaseline *huffman_table; guint i, num_tables; if (!priv->has_huf_table) gst_jpeg_get_default_huffman_tables(&priv->huf_tables); - picture->huf_table = GST_VAAPI_HUFFMAN_TABLE_NEW(JPEG, decoder); + picture->huf_table = GST_VAAPI_HUFFMAN_TABLE_NEW(JPEGBaseline, decoder); g_assert(picture->huf_table); huffman_table = picture->huf_table->param; @@ -277,6 +274,9 @@ fill_huffman_table( memcpy(huffman_table->huffman_table[i].ac_values, huf_tables->ac_tables[i].huf_values, sizeof(huffman_table->huffman_table[i].ac_values)); + memset(huffman_table->huffman_table[i].pad, + 0, + sizeof(huffman_table->huffman_table[i].pad)); } return TRUE; } @@ -345,7 +345,7 @@ decode_picture( if (priv->current_picture && !decode_current_picture(decoder)) return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; - picture = GST_VAAPI_PICTURE_NEW(JPEG, decoder); + picture = GST_VAAPI_PICTURE_NEW(JPEGBaseline, decoder); if (!picture) { GST_ERROR("failed to allocate picture"); return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; @@ -421,7 +421,7 @@ decode_scan( { GstVaapiDecoderJpegPrivate * const priv = decoder->priv; GstVaapiPicture *picture = priv->current_picture; - VASliceParameterBufferJPEG *slice_param; + VASliceParameterBufferJPEGBaseline *slice_param; GstVaapiSlice *gst_slice; guint total_h_samples, total_v_samples; GstJpegScanHdr scan_hdr; @@ -448,7 +448,7 @@ decode_scan( return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER; } - gst_slice = GST_VAAPI_SLICE_NEW(JPEG, decoder, scan_data, scan_data_size); + gst_slice = GST_VAAPI_SLICE_NEW(JPEGBaseline, decoder, scan_data, scan_data_size); gst_vaapi_picture_add_slice(picture, gst_slice); slice_param = gst_slice->param;