Sander Jansen | 14 May 2013 15:57
Picon

Playback Issue

I'm having issues playing back certain videos using mplayer and vaapi. It usually results in the audio getting out of sync pretty quickly with video not being able to keep up. mplayer usually will spit out a message that the system is too slow to play this, but system almost uses no CPU !?
I'm using the latest Intel drivers (2.21.6) and va-intel-driver 1.0.20 on a Ivy Bridge hardware (Intel NUC*). 
Comparing two videos where one doesn't work and the other plays fine:

slow.mp4**
1 video H264 High <at> 3.1, 2588.880 secs, 1833 kbps, 1280x720 <at> 25.000000 fps
2 audio MPEG-4 AAC LC, 2588.885 secs, 152 kbps, 44100 Hz

plays_fine.mp4
1 video H264 High <at> 3.1, 548.666 secs, 2913 kbps, 1280x720 <at> 24.000029 fps
2 audio MPEG-4 AAC LC, 548.687 secs, 256 kbps, 44100 Hz


Is this perhaps an issue of framerate? I also have the same exact problem when I switch from vaapi to the gl backend of mplayer. The x11 backend seems to work fine (no sync issues), but shows frame tearing.


**https://www.youtube.com/watch?v=Wm174EquYLc (video can be downloaded with the various command line tools like youtube-dl)

<div><div dir="ltr">
<div>I'm having issues playing back certain videos using mplayer and vaapi. It usually results in the audio getting out of sync pretty quickly with video not being able to keep up. mplayer usually will spit out a message that the system is too slow to play this, but system almost uses no CPU !?</div>
I'm using the latest Intel drivers (2.21.6) and va-intel-driver 1.0.20 on a Ivy Bridge hardware (Intel NUC*).&nbsp;<div>Comparing two videos where one doesn't work and the other plays fine:</div>
<div>
<br><div>
<div>
slow.mp4**≤/div>
<div>1<span class="">	</span>video<span class="">	</span>H264 High <at> 3.1, 2588.880 secs, 1833 kbps, 1280x720  <at>  25.000000 fps</div>
<div>2<span class="">	</span>audio<span class="">	</span>MPEG-4 AAC LC, 2588.885 secs, 152 kbps, 44100 Hz</div>
</div>
<div><br></div>
<div>plays_fine.mp4</div>
<div>
<div>1<span class="">	</span>video<span class="">	</span>H264 High <at> 3.1, 548.666 secs, 2913 kbps, 1280x720  <at>  24.000029 fps<br>
</div>
<div>2<span class="">	</span>audio<span class="">	</span>MPEG-4 AAC LC, 548.687 secs, 256 kbps, 44100 Hz</div>
<div><br></div>
<div><br></div>
<div>Is this perhaps an issue of framerate? I also have the same exact problem when I switch from vaapi to the gl backend of mplayer. The x11 backend seems to work fine (no sync issues), but shows frame tearing.</div>
<div><br></div>
<div><br></div>
</div>
<div>*<a href="http://www.intel.com/content/www/us/en/motherboards/desktop-motherboards/desktop-board-d33217gke.html">http://www.intel.com/content/www/us/en/motherboards/desktop-motherboards/desktop-board-d33217gke.html</a>&nbsp;<br>
</div>
</div>
<div>**≤a href="https://www.youtube.com/watch?v=Wm174EquYLc">https://www.youtube.com/watch?v=Wm174EquYLc</a>&nbsp;(video can be downloaded with the various command line tools like youtube-dl)</div>
<div><br></div>
</div></div>
Xiang, Haihao | 13 May 2013 10:18
Picon
Favicon

[PATCH 00/24] Merge video post-processing (VPP) APIs from staging branch

The VPP interface and the following filters are merged from staging 
Noise reduction
Deinterlacing
Sharpening
Color balance

Austin Yuan (1):
  VAProcPipelineParameterBufferType: start from 41 in case there are
    more encode buffer types to be added in future

Binglin Chen (1):
  Add maximum type number define, and one addition VPP flag

Gwenole Beauchesne (18):
  API: add video processing interfaces.
  vpp: link modules from the main page.
  vpp: fix VAProcPipelineParameterBuffer typedef.
  vpp: remove obsolete sample code.
  vpp: fix vaQueryVideoProcFilterCaps() prototype.
  vpp: improve documentation for VAProcPipelineParameterBuffer.
  vpp: mention that source surface also covers its associated
    subpictures.
  vpp: fix vaQueryVideoProcPipelineCaps() semantics.
  vpp: keep VAProcFilterParameterBuffer value type as float.
  vpp: clarify background color semantics and driver behaviour.
  vpp: add auto-saturation, auto-brightness, auto-contrast attributes.
  vpp: explain filter flags more.
  vpp: add pipeline flags.
  vpp: note that application of subpictures is now optional.
  vpp: move reference frames to pipeline parameter buffer.
  vpp: allow input/output color primaries as requested.
  vpp: fix comments for *Count enumerations.
  API: vpp: remove extraneous flags member.

Jonathan Bian (2):
  Added "flags" field to VAProcFilterParameterBufferDeinterlacing to
    indicate TOP/BOTTOM field in the input frame and which field to use
    for BOB deinterlacing.
  Renamed de-interlacing flags to be more general and added new flag
    VA_DEINTERLACING_ONE_FIELD

Xiang, Haihao (2):
  Fix sample code for VPP
  va: Remove VAProcFilterColorStandard

 va/va.h     |   35 +++-
 va/va_vpp.h |  749 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 782 insertions(+), 2 deletions(-)
 create mode 100644 va/va_vpp.h

--

-- 
1.7.4.1

Xiang, Haihao | 13 May 2013 09:55
Picon
Favicon

[PATCH 0/2] Merge MPEG-2 encoding APIs from staging

Xiang, Haihao (2):
  API for MPEG-2 encoding
  va: Remove user_data from MPEG-2 encoding APIs

 va/va_enc_mpeg2.h |  291 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 291 insertions(+), 0 deletions(-)
 create mode 100644 va/va_enc_mpeg2.h

--

-- 
1.7.4.1

Xiang, Haihao | 13 May 2013 09:51
Picon
Favicon

[PATCH 00/42] Merge H.264 encoding APIs from staging branch

Here is the original post with the RFC to support additional profiles
for H.264 encode and video post-processing

http://lists.freedesktop.org/archives/libva/2011-August/001372.html

After that, we refined the APIs and added the support for MPEG-2 encoding.
Here is the series of patches for the APIs for H.264 encoding, I will send 
out the pathes for video post-processing and MPEG-2 encoding APIs in other 
threads.

Austin Yuan (5):
  VACodedBufferSegment: modify the semantics/description
  VAEncMiscParameterRateControl: add back some fields and refine the
    comments
  VA_STATUS_ERROR_HW_BUSY: error code to indicate HW is busy
  VACodedBufferSegment: correct the description
  VAEncXXXH264Baseline: start to drop VAEncXXXXBaseline

Gwenole Beauchesne (32):
  doc: add placeholder for the Core API.
  API: add a generic value type.
  API: rename H.264 encoding buffer structs with a Baseline suffix.
  API: drop H.264 specific VA buffer types.
  API: add new H.264 encoding API for main and high profiles.
  API: h264 encode: re-define packed-headers buffer type ids.
  API: h264 encode: rename insert_emulation_bytes to
    has_emulation_bytes.
  API: h264 encode: add macroblock parameter buffer.
  API: h264 encode: add new config attributes for encoding
    (max-ref-frames).
  doc: link modules from the main page.
  API: h264 encode: improve VA config attributes documentation.
  API: h264 encode: renumber config attributes used for encoding.
  API: h264 encode: add new VA config attributes (max-slices,
    slice-structure).
  API: h264 encode: fix comments.
  API: h264 encode: add constant QP rate control attribute.
  API: h264 encode: remove TABs in newly added code.
  API: h264 encode: add max-frame-size misc buffer type.
  API: h264 encode: fix max-frame-size parameter buffer type.
  API: h264 encode: add macroblock-info config attribute.
  API: h264 encode: add packed SEI header.
  API: h264 encode: fix VAConfigAttribEncMaxRefFrames semantics.
  API: h264 encode: add VA_RC_VBR_CONSTRAINED.
  API: encode: document VACodedBufferSegment.
  API: h264 encode: drop profile_idc.
  API: h264 encode: drop extraneous comment.
  API: h264 encode: document DPB usage.
  API: h264 encode: add intra_idr_period to sequence parameter.
  API: h264 encode: fix comment for RefPicList0/1.
  API: h264 encode: remove ref_pic_list_modification().
  API: h264 encode: remove dec_ref_pic_marking().
  API: h264 encode: move up num_macroblocks, next to
    macroblock_address.
  API: h264 encode: add more explicit packed header types for H.264.

Jonathan Bian (3):
  Added new VAEncPackedHeaderRawData value to VAEncPackedHeaderType
  Added aspect ratio related fields to VAEncSequenceParameterBufferH264
  Added baseline to the list of profiles for the documentation.

Xiang, Haihao (2):
  Add VAEncMiscParameterHRD data structure to pass HRD parameters to
    driver
  va: Add a flag to signal APP whether the driver support raw packed
    header

 va/va.h          |  382 ++++++++++++++++++++++++++++++-----
 va/va_enc_h264.h |  592 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 918 insertions(+), 56 deletions(-)
 create mode 100644 va/va_enc_h264.h

--

-- 
1.7.4.1

yakui.zhao | 9 May 2013 08:21
Picon
Favicon

[PATCH] AVCENC: Pass the H264 RefPicList0/1 by using slice_param instead of hacked DPB reference

From: Zhao Yakui <yakui.zhao@...>

Signed-off-by: Zhao Yakui <yakui.zhao@...>
---
 test/encode/avcenc.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/test/encode/avcenc.c b/test/encode/avcenc.c
index 2097949..6e8bd4b 100644
--- a/test/encode/avcenc.c
+++ b/test/encode/avcenc.c
 <at>  <at>  -151,6 +151,8  <at>  <at>  static struct {
     int i_dpb_output_delay_length;
 } avcenc_context;

+static  VAPictureH264 ReferenceFrames[16], RefPicList0[32], RefPicList1[32];
+
 static void create_encode_pipe()
 {
     VAEntrypoint entrypoints[5];
 <at>  <at>  -443,6 +445,23  <at>  <at>  static void avcenc_update_slice_parameter(int slice_type)
     slice_param->idr_pic_id = 0;

     /* FIXME: fill other fields */
+    if ((slice_type == SLICE_TYPE_P) || (slice_type == SLICE_TYPE_B)) {
+	int j;
+	slice_param->RefPicList0[0].picture_id = surface_ids[SID_REFERENCE_PICTURE_L0];
+	for (j = 1; j < 32; j++) {
+	    slice_param->RefPicList0[j].picture_id = VA_INVALID_SURFACE;
+	    slice_param->RefPicList0[j].flags = VA_PICTURE_H264_INVALID;
+	}
+    }
+
+    if ((slice_type == SLICE_TYPE_B)) {
+	int j;
+	slice_param->RefPicList1[0].picture_id = surface_ids[SID_REFERENCE_PICTURE_L1];
+	for (j = 1; j < 32; j++) {
+	    slice_param->RefPicList1[j].picture_id = VA_INVALID_SURFACE;
+	    slice_param->RefPicList1[j].flags = VA_PICTURE_H264_INVALID;
+	}
+    }

     va_status = vaCreateBuffer(va_dpy,
                                avcenc_context.context_id,
--

-- 
1.7.12-rc1

Matt Pekar | 9 May 2013 00:27

invoking intel vaapi without video out on motherboard

Is it possible to take an intel CPU, motheboard w/out video output, and use VAAPI through it?

I'm trying to use a custom xorg.conf along these lines:

Section "Device"
        Identifier "intel0"
        Driver "intel"
EndSection

Section "Screen"
        Identifier "screen0"
        Device "intel0"
EndSection

But I'm unable to start X with this:

[  5507.348] (II) intel: Driver for Intel Integrated Graphics Chipsets: i810,
i810-dc100, i810e, i815, i830M, 845G, 854, 852GM/855GM, 865G, 915G,
E7221 (i915), 915GM, 945G, 945GM, 945GME, Pineview GM, Pineview G,
965G, G35, 965Q, 946GZ, 965GM, 965GME/GLE, G33, Q35, Q33, GM45,
4 Series, G45/G43, Q45/Q43, G41, B43, B43, Clarkdale, Arrandale,
Sandybridge Desktop (GT1), Sandybridge Desktop (GT2),
Sandybridge Desktop (GT2+), Sandybridge Mobile (GT1),
Sandybridge Mobile (GT2), Sandybridge Mobile (GT2+),
Sandybridge Server, Ivybridge Mobile (GT1), Ivybridge Mobile (GT2),
Ivybridge Desktop (GT1), Ivybridge Desktop (GT2), Ivybridge Server,
Ivybridge Server (GT2)
[  5507.348] (--) using VT number 7

[  5507.353] (EE) No devices detected.
[  5507.353] 
Fatal server error:
[  5507.353] no screens found
[  5507.354] 

Does X check that there is a physical video out on the motherboard for it to load a device?  Has anyone been able to use X and VAAPI in this sort of headless mode?  Would a better approach be to ditch X entirely and use VAAPI through DRM?

<div><div dir="ltr">
<div>Is it possible to take an intel CPU, motheboard w/out video output, and use VAAPI through it?</div>
<div><br></div>
<div>I'm trying to use a custom xorg.conf along these lines:</div>
<div><br></div>
<div>
<div>Section "Device"</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Identifier "intel0"</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Driver "intel"</div>
<div>EndSection</div>
<div><br></div>
<div>
<div>Section "Screen"</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Identifier "screen0"</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Device "intel0"<br>
</div>
<div>EndSection</div>
</div>
<div><br></div>
<div>But I'm unable to start X with this:</div>
<div><br></div>
<div>
[ &nbsp;5507.348] (II) intel: Driver for Intel Integrated Graphics Chipsets: i810,</div>
<div>
<span class="">	</span>i810-dc100, i810e, i815, i830M, 845G, 854, 852GM/855GM, 865G, 915G,</div>
<div>
<span class="">	</span>E7221 (i915), 915GM, 945G, 945GM, 945GME, Pineview GM, Pineview G,</div>
<div>
<span class="">	</span>965G, G35, 965Q, 946GZ, 965GM, 965GME/GLE, G33, Q35, Q33, GM45,</div>
<div>
<span class="">	</span>4 Series, G45/G43, Q45/Q43, G41, B43, B43, Clarkdale, Arrandale,</div>
<div>
<span class="">	</span>Sandybridge Desktop (GT1), Sandybridge Desktop (GT2),</div>
<div>
<span class="">	</span>Sandybridge Desktop (GT2+), Sandybridge Mobile (GT1),</div>
<div>
<span class="">	</span>Sandybridge Mobile (GT2), Sandybridge Mobile (GT2+),</div>
<div>
<span class="">	</span>Sandybridge Server, Ivybridge Mobile (GT1), Ivybridge Mobile (GT2),</div>
<div>
<span class="">	</span>Ivybridge Desktop (GT1), Ivybridge Desktop (GT2), Ivybridge Server,</div>
<div>
<span class="">	</span>Ivybridge Server (GT2)</div>
<div>[ &nbsp;5507.348] (--) using VT number 7</div>
<div><br></div>
<div>[ &nbsp;5507.353] (EE) No devices detected.</div>
<div>[ &nbsp;5507.353]&nbsp;</div>
<div>Fatal server error:</div>
<div>[ &nbsp;5507.353] no screens found</div>
<div>[ &nbsp;5507.354]&nbsp;</div>
<div><br></div>
<div>Does X check that there is a physical video out on the motherboard for it to load a device? &nbsp;Has anyone been able to use X and VAAPI in this sort of headless mode? &nbsp;Would a better approach be to ditch X entirely and use VAAPI through DRM?<br>
</div>
<div><br></div>
</div>
</div></div>
yakui.zhao | 28 Apr 2013 03:03
Picon
Favicon

[PATCH 1/2] Remove the EGL dependency on X11

From: Zhao Yakui <yakui.zhao@...>

Otherwise when x11 is disabled, it can't be compiled correctly.

Signed-off-by: Zhao Yakui <yakui.zhao@...>
---
 va/Makefile.am | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/va/Makefile.am b/va/Makefile.am
index 9a3cd2f..0fce165 100644
--- a/va/Makefile.am
+++ b/va/Makefile.am
 <at>  <at>  -118,8 +118,8  <at>  <at>  SUBDIRS				+= egl
 lib_LTLIBRARIES			+= libva-egl.la
 libva_egl_la_SOURCES		=
 libva_egl_la_LDFLAGS		= $(LDADD)
-libva_egl_la_DEPENDENCIES	= libva.la egl/libva_egl.la libva-x11.la
-libva_egl_la_LIBADD		= libva.la egl/libva_egl.la libva-x11.la \
+libva_egl_la_DEPENDENCIES	= libva.la egl/libva_egl.la 
+libva_egl_la_LIBADD		= libva.la egl/libva_egl.la \
 	$(EGL_LIBS) -ldl
 endif

--

-- 
1.8.2-rc2

yakui.zhao | 27 Apr 2013 10:56
Picon
Favicon

[PATCH 1/2] Remove the EGL dependency on X11

From: Zhao Yakui <yakui.zhao@...>

Otherwise when x11 is enabled on libva, it can't be compiled
correctly.

Signed-off-by: Zhao Yakui <yakui.zhao@...>
---
 va/Makefile.am | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/va/Makefile.am b/va/Makefile.am
index 9a3cd2f..0fce165 100644
--- a/va/Makefile.am
+++ b/va/Makefile.am
 <at>  <at>  -118,8 +118,8  <at>  <at>  SUBDIRS				+= egl
 lib_LTLIBRARIES			+= libva-egl.la
 libva_egl_la_SOURCES		=
 libva_egl_la_LDFLAGS		= $(LDADD)
-libva_egl_la_DEPENDENCIES	= libva.la egl/libva_egl.la libva-x11.la
-libva_egl_la_LIBADD		= libva.la egl/libva_egl.la libva-x11.la \
+libva_egl_la_DEPENDENCIES	= libva.la egl/libva_egl.la 
+libva_egl_la_LIBADD		= libva.la egl/libva_egl.la \
 	$(EGL_LIBS) -ldl
 endif

--

-- 
1.8.2-rc2

Zhao Halley | 27 Apr 2013 10:12
Picon
Favicon

[PATCH] fix build issue when there is wayland platform support only

---
 test/Makefile.am            |    3 +++
 test/putsurface/Makefile.am |    5 ++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/test/Makefile.am b/test/Makefile.am
index 451b90f..c75e006 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
 <at>  <at>  -25,5 +25,8  <at>  <at>  SUBDIRS = common decode encode vainfo
 if USE_X11
 SUBDIRS += basic putsurface v4l_h264
 endif
+if USE_WAYLAND
+SUBDIRS += putsurface
+endif

 EXTRA_DIST = loadsurface.h loadsurface_yuv.h
diff --git a/test/putsurface/Makefile.am b/test/putsurface/Makefile.am
index 8ffe255..e6dbe57 100644
--- a/test/putsurface/Makefile.am
+++ b/test/putsurface/Makefile.am
 <at>  <at>  -20,7 +20,6  <at>  <at> 
 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

-bin_PROGRAMS = putsurface

 AM_CPPFLAGS = \
 	-I$(top_srcdir)		\
 <at>  <at>  -36,11 +35,15  <at>  <at>  TEST_LIBS = \
 	-lpthread		\
 	$(NULL)

+bin_PROGRAMS =
+if USE_X11
+bin_PROGRAMS += putsurface
 putsurface_SOURCES		= putsurface_x11.c
 putsurface_CFLAGS		= $(X11_CFLAGS) $(TEST_CFLAGS)
 putsurface_LDADD		= $(X11_LIBS) $(TEST_LIBS)	\
 	$(top_builddir)/va/libva-x11.la			\
 	$(NULL)
+endif

 if USE_WAYLAND
 bin_PROGRAMS			+= putsurface_wayland
--

-- 
1.7.9.5

Zhao Halley | 27 Apr 2013 09:18
Picon
Favicon

[PATCH] fix build issue when there is wayland platform support only

---
 test/Makefile.am                         |    3 +
 test/putsurface/Makefile.am              |    5 +-
 va/wayland/va_wayland_pvr.c              |  202 ++++++++++++++++++++++++++++++
 va/wayland/va_wayland_pvr.h              |   52 ++++++++
 va/wayland/wayland-pvr-client-protocol.h |   68 ++++++++++
 5 files changed, 329 insertions(+), 1 deletion(-)
 create mode 100755 va/wayland/va_wayland_pvr.c
 create mode 100755 va/wayland/va_wayland_pvr.h
 create mode 100755 va/wayland/wayland-pvr-client-protocol.h

diff --git a/test/Makefile.am b/test/Makefile.am
index 451b90f..c75e006 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
 <at>  <at>  -25,5 +25,8  <at>  <at>  SUBDIRS = common decode encode vainfo
 if USE_X11
 SUBDIRS += basic putsurface v4l_h264
 endif
+if USE_WAYLAND
+SUBDIRS += putsurface
+endif

 EXTRA_DIST = loadsurface.h loadsurface_yuv.h
diff --git a/test/putsurface/Makefile.am b/test/putsurface/Makefile.am
index 8ffe255..e6dbe57 100644
--- a/test/putsurface/Makefile.am
+++ b/test/putsurface/Makefile.am
 <at>  <at>  -20,7 +20,6  <at>  <at> 
 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

-bin_PROGRAMS = putsurface

 AM_CPPFLAGS = \
 	-I$(top_srcdir)		\
 <at>  <at>  -36,11 +35,15  <at>  <at>  TEST_LIBS = \
 	-lpthread		\
 	$(NULL)

+bin_PROGRAMS =
+if USE_X11
+bin_PROGRAMS += putsurface
 putsurface_SOURCES		= putsurface_x11.c
 putsurface_CFLAGS		= $(X11_CFLAGS) $(TEST_CFLAGS)
 putsurface_LDADD		= $(X11_LIBS) $(TEST_LIBS)	\
 	$(top_builddir)/va/libva-x11.la			\
 	$(NULL)
+endif

 if USE_WAYLAND
 bin_PROGRAMS			+= putsurface_wayland
diff --git a/va/wayland/va_wayland_pvr.c b/va/wayland/va_wayland_pvr.c
new file mode 100755
index 0000000..8f9b8fd
--- /dev/null
+++ b/va/wayland/va_wayland_pvr.c
 <at>  <at>  -0,0 +1,202  <at>  <at> 
+/*
+ * va_wayland_pvr.c - Wayland/PVR helpers
+ *
+ * Copyright (c) 2012 Intel Corporation. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL INTEL AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "sysdeps.h"
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <dlfcn.h>
+#include <sys/stat.h>
+#include <xf86drm.h>
+#include "va_drmcommon.h"
+#include "drm/va_drm_utils.h"
+#include "va_wayland_pvr.h"
+#include "va_wayland_private.h"
+#include "wayland-pvr-client-protocol.h"
+
+/* XXX: Wayland/PVR support currently lives in libEGL.so.* library */
+#define LIBWAYLAND_PVR_NAME "libEGL.so.1"
+
+typedef struct va_wayland_pvr_context {
+    struct va_wayland_context   base;
+    void                       *handle;
+    struct wl_pvr              *pvr;
+    struct wl_registry         *registry;
+    void                       *pvr_interface;
+    unsigned int                is_authenticated        : 1;
+} VADisplayContextWaylandPVR;
+
+static int open_device (char *dev_name)
+{
+    struct stat st;
+    int fd;
+
+    if (-1 == stat (dev_name, &st))
+    {
+        printf ("Cannot identify '%s': %d, %s\n",
+                dev_name, errno, strerror (errno));
+        return -1;
+    }
+
+    if (!S_ISCHR (st.st_mode))
+    {
+        printf ("%s is no device\n", dev_name);
+        return -1;
+    }
+
+    fd = open (dev_name, O_RDWR);
+
+    if (-1 == fd)
+    {
+        fprintf (stderr, "Cannot open '%s': %d, %s\n",
+                 dev_name, errno, strerror (errno));
+        return -1;
+    }
+
+    return fd;
+}
+
+
+#define DEVICE_NAME "/dev/dri/card0"
+
+static VAStatus
+va_DisplayContextGetDriverName(
+    VADisplayContextP pDisplayContext,
+    char            **driver_name_ptr
+)
+{
+    VADriverContextP const ctx = pDisplayContext->pDriverContext;
+    struct drm_state * drm_state = (struct drm_state *)ctx->drm_state;
+
+    memset(drm_state, 0, sizeof(*drm_state));
+    drm_state->fd = open_device((char *)DEVICE_NAME);
+
+    if (drm_state->fd < 0) {
+        fprintf(stderr,"can't open DRM devices\n");
+        return VA_STATUS_ERROR_UNKNOWN;
+    }
+    drm_state->auth_type = VA_DRM_AUTH_CUSTOM;
+
+    return VA_DRM_GetDriverName(ctx, driver_name_ptr);
+}
+
+void
+va_wayland_pvr_destroy(VADisplayContextP pDisplayContext)
+{
+    VADriverContextP const ctx = pDisplayContext->pDriverContext;
+    struct va_wayland_pvr_context * const wl_pvr_ctx = pDisplayContext->opaque;
+    struct drm_state * const drm_state = ctx->drm_state;
+
+    if (wl_pvr_ctx->pvr) {
+        wl_pvr_destroy(wl_pvr_ctx->pvr);
+        wl_pvr_ctx->pvr = NULL;
+    }
+    wl_pvr_ctx->is_authenticated = 0;
+
+    if (wl_pvr_ctx->handle) {
+        dlclose(wl_pvr_ctx->handle);
+        wl_pvr_ctx->handle = NULL;
+    }
+
+    if (drm_state) {
+        if (drm_state->fd >= 0) {
+            close(drm_state->fd);
+            drm_state->fd = -1;
+        }
+        free(ctx->drm_state);
+        ctx->drm_state = NULL;
+    }
+}
+
+static void
+registry_handle_global(
+    void               *data,
+    struct wl_registry *registry,
+    uint32_t            id,
+    const char         *interface,
+    uint32_t            version
+)
+{
+    struct va_wayland_pvr_context *wl_pvr_ctx = data;
+
+    if (strcmp(interface, "wl_pvr") == 0) {
+        wl_pvr_ctx->pvr =
+            wl_registry_bind(wl_pvr_ctx->registry, id, wl_pvr_ctx->pvr_interface, 1);
+    }
+}
+
+static const struct wl_registry_listener registry_listener = {
+    registry_handle_global,
+    NULL,
+};
+
+bool
+va_wayland_pvr_create(VADisplayContextP pDisplayContext)
+{
+    VADriverContextP const ctx = pDisplayContext->pDriverContext;
+    struct va_wayland_pvr_context *wl_pvr_ctx;
+    struct drm_state *drm_state;
+    uint32_t id;
+
+    wl_pvr_ctx = malloc(sizeof(*wl_pvr_ctx));
+    if (!wl_pvr_ctx)
+        return false;
+    wl_pvr_ctx->base.destroy            = va_wayland_pvr_destroy;
+    wl_pvr_ctx->handle                  = NULL;
+    wl_pvr_ctx->pvr                     = NULL;
+    wl_pvr_ctx->pvr_interface           = NULL;
+    wl_pvr_ctx->is_authenticated        = 0;
+    pDisplayContext->opaque             = wl_pvr_ctx;
+    pDisplayContext->vaGetDriverName    = va_DisplayContextGetDriverName;
+
+    drm_state = calloc(1, sizeof(struct drm_state));
+    if (!drm_state)
+        return false;
+    drm_state->fd        = -1;
+    drm_state->auth_type = 0;
+    ctx->drm_state       = drm_state;
+
+    wl_pvr_ctx->handle = dlopen(LIBWAYLAND_PVR_NAME, RTLD_LAZY|RTLD_LOCAL);
+    if (!wl_pvr_ctx->handle)
+        return false;
+
+    wl_pvr_ctx->pvr_interface =
+        dlsym(wl_pvr_ctx->handle, "wl_pvr_interface");
+    if (!wl_pvr_ctx->pvr_interface)
+        return false;
+
+    wl_pvr_ctx->registry = wl_display_get_registry(ctx->native_dpy);
+    wl_registry_add_listener(wl_pvr_ctx->registry, &registry_listener, wl_pvr_ctx);
+    wl_display_roundtrip(ctx->native_dpy);
+
+    /* registry_handle_global should have been called by the
+     * wl_display_roundtrip above
+     */
+    if (!wl_pvr_ctx->pvr)
+        return false;
+
+    return true;
+}
diff --git a/va/wayland/va_wayland_pvr.h b/va/wayland/va_wayland_pvr.h
new file mode 100755
index 0000000..e970368
--- /dev/null
+++ b/va/wayland/va_wayland_pvr.h
 <at>  <at>  -0,0 +1,52  <at>  <at> 
+/*
+ * va_wayland_emgd.h - Wayland/EMGD helpers
+ *
+ * Copyright (c) 2012 Intel Corporation. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL INTEL AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef VA_WAYLAND_PVR_H
+#define VA_WAYLAND_PVR_H
+
+#include <stdbool.h>
+#include "va_wayland.h"
+#include "va_backend.h"
+#include "va_backend_wayland.h"
+
+/**
+ * \brief Initializes Wayland/EMGD layer.
+ *
+ * This is an internal function used to initialize the VA/EMGD subsystem
+ * if the application is running on an EMGD-based server.
+ *
+ *  <at> param[in]   pDisplayContext the VA display context
+ *  <at> return true if successful
+ */
+DLL_HIDDEN
+bool
+va_wayland_pvr_create(VADisplayContextP pDisplayContext);
+
+DLL_HIDDEN
+void
+va_wayland_pvr_destroy(VADisplayContextP pDisplayContext);
+
+#endif /* VA_WAYLAND_PVR_H */
diff --git a/va/wayland/wayland-pvr-client-protocol.h b/va/wayland/wayland-pvr-client-protocol.h
new file mode 100755
index 0000000..0331e71
--- /dev/null
+++ b/va/wayland/wayland-pvr-client-protocol.h
 <at>  <at>  -0,0 +1,68  <at>  <at> 
+#ifndef PVR_CLIENT_PROTOCOL_H
+#define PVR_CLIENT_PROTOCOL_H
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-client.h"
+
+struct wl_client;
+struct wl_resource;
+
+struct wl_pvr;
+
+extern const struct wl_interface wl_pvr_interface;
+
+#ifndef WL_PVR_FORMAT_ENUM
+#define WL_PVR_FORMAT_ENUM
+enum wl_pvr_format {
+	WL_PVR_FORMAT_ARGB32 = 0,
+	WL_PVR_FORMAT_PREMULTIPLIED_ARGB32 = 1,
+	WL_PVR_FORMAT_XRGB32 = 2,
+};
+#endif /* WL_PVR_FORMAT_ENUM */
+
+#define WL_PVR_CREATE_BUFFER	0
+
+static inline void
+wl_pvr_set_user_data(struct wl_pvr *wl_pvr, void *user_data)
+{
+	wl_proxy_set_user_data((struct wl_proxy *) wl_pvr, user_data);
+}
+
+static inline void *
+wl_pvr_get_user_data(struct wl_pvr *wl_pvr)
+{
+	return wl_proxy_get_user_data((struct wl_proxy *) wl_pvr);
+}
+
+static inline void
+wl_pvr_destroy(struct wl_pvr *wl_pvr)
+{
+	wl_proxy_destroy((struct wl_proxy *) wl_pvr);
+}
+
+static inline struct wl_buffer *
+wl_pvr_create_buffer(struct wl_pvr *wl_pvr, uint32_t handle, int32_t width, int32_t height,
uint32_t stride, uint32_t format)
+{
+	struct wl_proxy *id;
+
+	id = wl_proxy_create((struct wl_proxy *) wl_pvr,
+			     &wl_buffer_interface);
+	if (!id)
+		return NULL;
+
+	wl_proxy_marshal((struct wl_proxy *) wl_pvr,
+			 WL_PVR_CREATE_BUFFER, id, handle, width, height, stride, format);
+
+	return (struct wl_buffer *) id;
+}
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif
--

-- 
1.7.9.5

kwisp | 24 Apr 2013 20:46
Picon

Crash example code avenc.cpp. H264. EMGD. Debian Squeeze.

There is h264 encoding example from libva source code. libva/test/v4l_h264/encode.
I build this code success, but get crash after run.

libva info: VA-API version 0.33.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/local/lib/dri/emgd_drv_video.so
libva info: Found init function __vaDriverInit_0_32
Intel(R) Embedded Media and Graphics Driver 1.10 Build 2209
libva info: va_openDriver() returns 0
Using: localhost:8888
video capture
    VIDIOC_ENUM_FMT(0,VIDEO_CAPTURE)
pfmt: 0x56595559 YUV 4:2:2 (YUYV)
       VIDIOC_ENUM_FRAMESIZES(0,0x1) 640x480  <at> 1/30  1/24  1/20  1/15  1/10  2/15  1/5
       VIDIOC_ENUM_FRAMESIZES(1,0x1) 160x120  <at> 1/30  1/24  1/20  1/15  1/10  2/15  1/5
       VIDIOC_ENUM_FRAMESIZES(2,0x1) 176x144  <at> 1/30  1/24  1/20  1/15  1/10  2/15  1/5
       VIDIOC_ENUM_FRAMESIZES(3,0x1) 320x176  <at> 1/30  1/24  1/20  1/15  1/10  2/15  1/5
       VIDIOC_ENUM_FRAMESIZES(4,0x1) 320x240  <at> 1/30  1/24  1/20  1/15  1/10  2/15  1/5
       VIDIOC_ENUM_FRAMESIZES(5,0x1) 432x240  <at> 1/30  1/24  1/20  1/15  1/10  2/15  1/5
       VIDIOC_ENUM_FRAMESIZES(6,0x1) 352x288  <at> 1/30  1/24  1/20  1/15  1/10  2/15  1/5
       VIDIOC_ENUM_FRAMESIZES(7,0x1) 544x288  <at> 1/30  1/24  1/20  1/15  1/10  2/15  1/5
       VIDIOC_ENUM_FRAMESIZES(8,0x1) 640x360  <at> 1/30  1/24  1/20  1/15  1/10  2/15  1/5
       VIDIOC_ENUM_FRAMESIZES(9,0x1) 752x416  <at> 1/24  1/20  1/15  1/10  2/15  1/5
       VIDIOC_ENUM_FRAMESIZES(10,0x1) 800x448  <at> 1/24  1/20  1/15  1/10  2/15  1/5
       VIDIOC_ENUM_FRAMESIZES(11,0x1) 864x480  <at> 1/20  1/15  1/10  2/15  1/5
       VIDIOC_ENUM_FRAMESIZES(12,0x1) 960x544  <at> 1/20  1/15  1/10  2/15  1/5
       VIDIOC_ENUM_FRAMESIZES(13,0x1) 1024x576  <at> 1/15  1/10  2/15  1/5
       VIDIOC_ENUM_FRAMESIZES(14,0x1) 800x600  <at> 1/24  1/20  1/15  1/10  2/15  1/5
       VIDIOC_ENUM_FRAMESIZES(15,0x1) 1184x656  <at> 1/15  1/10  2/15  1/5
       VIDIOC_ENUM_FRAMESIZES(16,0x1) 960x720  <at> 1/15  1/10  2/15  1/5
       VIDIOC_ENUM_FRAMESIZES(17,0x1) 1280x720  <at> 1/10  2/15  1/5
       VIDIOC_ENUM_FRAMESIZES(18,0x1) 1392x768  <at> 1/10  2/15  1/5
       VIDIOC_ENUM_FRAMESIZES(19,0x1) 1504x832  <at> 2/15  1/5
       VIDIOC_ENUM_FRAMESIZES(20,0x1) 1600x896  <at> 2/15  1/5
       VIDIOC_ENUM_FRAMESIZES(21,0x1) 1280x960  <at> 2/15  1/5
       VIDIOC_ENUM_FRAMESIZES(22,0x1) 1280x1024  <at> 2/15  1/5
       VIDIOC_ENUM_FRAMESIZES(23,0x1) 1600x1200  <at> 1/5
    VIDIOC_ENUM_FMT(1,VIDEO_CAPTURE)
pfmt: 0x47504a4d MJPEG
   => don't list not supported format
video: 640x480; fourcc:0x56595559
video: 640x480; fourcc:0x56595559
INFO: 640x480 <at> 1/30
negotiated frame resolution: 640x480
create_encode_pipe:vaCreateContext(152) failed, exit

I try to modify code in place where called vaCreateContext(...) file avenc.cpp
before my changes:
...
va_status = vaCreateContext(va_dpy, config_id, picture_width, picture_height, VA_PROGRESSIVE, 0, 0, &context_id);
...

after:

....   
  va_status = vaCreateSurfaces(va_dpy, picture_width, picture_height, VA_RT_FORMAT_YUV420, SID_NUMBER, &surface_ids[0]);
  va_status = vaCreateContext(va_dpy, config_id, picture_width, picture_height, VA_PROGRESSIVE, surface_ids, SID_NUMBER, &context_id);
....

after that:
.....
negotiated frame resolution: 640x480
libva: libva version 0.32.0
libva: va_getDriverName() returns 0
libva: Trying to open /usr/lib/dri/emgd_drv_video.so
Intel(R) Embedded Media and Graphics Driver 1.10 Build 2209
libva: va_openDriver() returns 0

Program received signal SIGSEGV, Segmentation fault.
0xb788d716 in ?? () from /usr/lib/dri/emgd_drv_video.so

Why this example of code do not work ?

--
-----------------------------------------
С Уважением, Клочков В.В.
mailto: kwispost-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
<div><div dir="ltr">
<div>There is h264 encoding example from libva source code. libva/test/v4l_h264/encode.<br>
</div>I build this code success, but get crash after run.<br><br>libva info: VA-API version 0.33.0<br>libva info: va_getDriverName() returns 0<br>
libva info: Trying to open /usr/local/lib/dri/emgd_drv_video.so<br>libva info: Found init function __vaDriverInit_0_32<br>Intel(R) Embedded Media and Graphics Driver 1.10 Build 2209<br>libva info: va_openDriver() returns 0<br>
Using: localhost:8888<br>video capture<br>&nbsp;&nbsp;&nbsp; VIDIOC_ENUM_FMT(0,VIDEO_CAPTURE)<br>pfmt: 0x56595559 YUV 4:2:2 (YUYV)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VIDIOC_ENUM_FRAMESIZES(0,0x1) 640x480&nbsp;  <at>  1/30&nbsp; 1/24&nbsp; 1/20&nbsp; 1/15&nbsp; 1/10&nbsp; 2/15&nbsp; 1/5 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VIDIOC_ENUM_FRAMESIZES(1,0x1) 160x120&nbsp;  <at>  1/30&nbsp; 1/24&nbsp; 1/20&nbsp; 1/15&nbsp; 1/10&nbsp; 2/15&nbsp; 1/5 <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VIDIOC_ENUM_FRAMESIZES(2,0x1) 176x144&nbsp;  <at>  1/30&nbsp; 1/24&nbsp; 1/20&nbsp; 1/15&nbsp; 1/10&nbsp; 2/15&nbsp; 1/5 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VIDIOC_ENUM_FRAMESIZES(3,0x1) 320x176&nbsp;  <at>  1/30&nbsp; 1/24&nbsp; 1/20&nbsp; 1/15&nbsp; 1/10&nbsp; 2/15&nbsp; 1/5 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VIDIOC_ENUM_FRAMESIZES(4,0x1) 320x240&nbsp;  <at>  1/30&nbsp; 1/24&nbsp; 1/20&nbsp; 1/15&nbsp; 1/10&nbsp; 2/15&nbsp; 1/5 <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VIDIOC_ENUM_FRAMESIZES(5,0x1) 432x240&nbsp;  <at>  1/30&nbsp; 1/24&nbsp; 1/20&nbsp; 1/15&nbsp; 1/10&nbsp; 2/15&nbsp; 1/5 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VIDIOC_ENUM_FRAMESIZES(6,0x1) 352x288&nbsp;  <at>  1/30&nbsp; 1/24&nbsp; 1/20&nbsp; 1/15&nbsp; 1/10&nbsp; 2/15&nbsp; 1/5 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VIDIOC_ENUM_FRAMESIZES(7,0x1) 544x288&nbsp;  <at>  1/30&nbsp; 1/24&nbsp; 1/20&nbsp; 1/15&nbsp; 1/10&nbsp; 2/15&nbsp; 1/5 <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VIDIOC_ENUM_FRAMESIZES(8,0x1) 640x360&nbsp;  <at>  1/30&nbsp; 1/24&nbsp; 1/20&nbsp; 1/15&nbsp; 1/10&nbsp; 2/15&nbsp; 1/5 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VIDIOC_ENUM_FRAMESIZES(9,0x1) 752x416&nbsp;  <at>  1/24&nbsp; 1/20&nbsp; 1/15&nbsp; 1/10&nbsp; 2/15&nbsp; 1/5 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VIDIOC_ENUM_FRAMESIZES(10,0x1) 800x448&nbsp;  <at>  1/24&nbsp; 1/20&nbsp; 1/15&nbsp; 1/10&nbsp; 2/15&nbsp; 1/5 <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VIDIOC_ENUM_FRAMESIZES(11,0x1) 864x480&nbsp;  <at>  1/20&nbsp; 1/15&nbsp; 1/10&nbsp; 2/15&nbsp; 1/5 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VIDIOC_ENUM_FRAMESIZES(12,0x1) 960x544&nbsp;  <at>  1/20&nbsp; 1/15&nbsp; 1/10&nbsp; 2/15&nbsp; 1/5 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VIDIOC_ENUM_FRAMESIZES(13,0x1) 1024x576&nbsp;  <at>  1/15&nbsp; 1/10&nbsp; 2/15&nbsp; 1/5 <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VIDIOC_ENUM_FRAMESIZES(14,0x1) 800x600&nbsp;  <at>  1/24&nbsp; 1/20&nbsp; 1/15&nbsp; 1/10&nbsp; 2/15&nbsp; 1/5 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VIDIOC_ENUM_FRAMESIZES(15,0x1) 1184x656&nbsp;  <at>  1/15&nbsp; 1/10&nbsp; 2/15&nbsp; 1/5 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VIDIOC_ENUM_FRAMESIZES(16,0x1) 960x720&nbsp;  <at>  1/15&nbsp; 1/10&nbsp; 2/15&nbsp; 1/5 <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VIDIOC_ENUM_FRAMESIZES(17,0x1) 1280x720&nbsp;  <at>  1/10&nbsp; 2/15&nbsp; 1/5 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VIDIOC_ENUM_FRAMESIZES(18,0x1) 1392x768&nbsp;  <at>  1/10&nbsp; 2/15&nbsp; 1/5 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VIDIOC_ENUM_FRAMESIZES(19,0x1) 1504x832&nbsp;  <at>  2/15&nbsp; 1/5 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VIDIOC_ENUM_FRAMESIZES(20,0x1) 1600x896&nbsp;  <at>  2/15&nbsp; 1/5 <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VIDIOC_ENUM_FRAMESIZES(21,0x1) 1280x960&nbsp;  <at>  2/15&nbsp; 1/5 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VIDIOC_ENUM_FRAMESIZES(22,0x1) 1280x1024&nbsp;  <at>  2/15&nbsp; 1/5 <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VIDIOC_ENUM_FRAMESIZES(23,0x1) 1600x1200&nbsp;  <at>  1/5 <br>&nbsp;&nbsp;&nbsp; VIDIOC_ENUM_FMT(1,VIDEO_CAPTURE)<br>
pfmt: 0x47504a4d MJPEG<br>&nbsp;&nbsp; =&gt; don't list not supported format<br>video: 640x480; fourcc:0x56595559<br>video: 640x480; fourcc:0x56595559<br>INFO: 640x480 <at> 1/30<br>negotiated frame resolution: 640x480<br>create_encode_pipe:vaCreateContext(152) failed, exit<br><br clear="all"><div><div><div>
<div></div>
<div>I try to modify code in place where called vaCreateContext(...) file avenc.cpp<br>
</div>
<div></div>
<div>before my changes:<br>...<br>va_status = vaCreateContext(va_dpy, config_id, picture_width, picture_height, VA_PROGRESSIVE, 0, 0, &amp;context_id);<br>
</div>
<div>...<br><br>
</div>
<div>after:<br><br>....&nbsp;&nbsp;&nbsp; <br>&nbsp; va_status = vaCreateSurfaces(va_dpy, picture_width, picture_height, VA_RT_FORMAT_YUV420, SID_NUMBER, &amp;surface_ids[0]);<br>&nbsp; va_status = vaCreateContext(va_dpy, config_id, picture_width, picture_height, VA_PROGRESSIVE, surface_ids, SID_NUMBER, &amp;context_id);<br>
....<br>
</div>
<div><br></div>
<div>after that:<br>.....<br>negotiated frame resolution: 640x480<br>libva: libva version 0.32.0<br>libva: va_getDriverName() returns 0<br>libva: Trying to open /usr/lib/dri/emgd_drv_video.so<br>
Intel(R) Embedded Media and Graphics Driver 1.10 Build 2209<br>libva: va_openDriver() returns 0<br><br>Program received signal SIGSEGV, Segmentation fault.<br>0xb788d716 in ?? () from /usr/lib/dri/emgd_drv_video.so<br>
</div>
<div><br></div>
<div>Why this example of code do not work ?<br>
</div>
<div>
<br>-- <br>-----------------------------------------<br>&#1057; &#1059;&#1074;&#1072;&#1078;&#1077;&#1085;&#1080;&#1077;&#1084;, &#1050;&#1083;&#1086;&#1095;&#1082;&#1086;&#1074; &#1042;.&#1042;.<br>mailto: <a href="mailto:kwispost@..." target="_blank">kwispost@...</a>
</div>
</div></div></div>
</div></div>

Gmane