SDL and VLC example compile errors

Hi everybody,

I am trying to test this example
http://wiki.videolan.org/LibVLC_SampleCode_SDL but I have these
errors:

g++ TestVLC.cpp -o TestVLC -lSDL

TestVLC.cpp: In function ?void* lock(void*, void**)?:
TestVLC.cpp:30: error: invalid conversion from ?void*? to ?ctx*?
TestVLC.cpp: In function ?void unlock(void*, void*, void* const*)?:
TestVLC.cpp:40: error: invalid conversion from ?void*? to ?ctx*?
TestVLC.cpp:43: error: invalid conversion from ?void*? to ?uint16_t*?

I want to see movies in a SDL_Surface. avi, flc, mp4, etc.

I use Debian stable

I’ve resorted to this implementation, but it is crashing the GL driver
http://bugzilla.libsdl.org/show_bug.cgi?id=1129

Any comment or improvement is welcome!
VittorioOn Wed, Nov 23, 2011 at 9:07 AM, Altair Linux wrote:

Hi everybody,

I am trying to test this example
http://wiki.videolan.org/LibVLC_SampleCode_SDL but I have these
errors:

g++ TestVLC.cpp -o TestVLC -lSDL

TestVLC.cpp: In function ?void* lock(void*, void**)?:
TestVLC.cpp:30: error: invalid conversion from ?void*? to ?ctx*?
TestVLC.cpp: In function ?void unlock(void*, void*, void* const*)?:
TestVLC.cpp:40: error: invalid conversion from ?void*? to ?ctx*?
TestVLC.cpp:43: error: invalid conversion from ?void*? to ?uint16_t*?

I want to see movies in a SDL_Surface. avi, flc, mp4, etc.

I use Debian stable


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

You should save this as a .c file, not .cpp and compile with gcc, not g++On Nov 23, 2011, at 12:07 AM, Altair Linux wrote:

Hi everybody,

I am trying to test this example
http://wiki.videolan.org/LibVLC_SampleCode_SDL but I have these
errors:

g++ TestVLC.cpp -o TestVLC -lSDL

TestVLC.cpp: In function ?void* lock(void*, void**)?:
TestVLC.cpp:30: error: invalid conversion from ?void*? to ?ctx*?
TestVLC.cpp: In function ?void unlock(void*, void*, void* const*)?:
TestVLC.cpp:40: error: invalid conversion from ?void*? to ?ctx*?
TestVLC.cpp:43: error: invalid conversion from ?void*? to ?uint16_t*?

I want to see movies in a SDL_Surface. avi, flc, mp4, etc.

I use Debian stable


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I just took a brief look, and spotted this:

static void *lock (void *data, void **p_pixels) {
struct ctx *ctx = data;

 SDL_LockMutex(ctx->mutex);
 int pitch = 1920*3;
 SDL_LockTexture(ctx->tex, NULL, p_pixels, &pitch);
 return NULL; /* picture identifier, not needed here */

}

The pitch is returned, not provided. “int pitch = 1920*3” is bogus, and
not returning it and handling it later is problematic.

It could be that NONPOT textures are allowed on some platforms, and not
on others (NONPOT - Non Power of Two)On 11/23/11 12:56 AM, Vittorio Giovara wrote:

I’ve resorted to this implementation, but it is crashing the GL driver
http://bugzilla.libsdl.org/show_bug.cgi?id=1129

Any comment or improvement is welcome!
Vittorio

On Wed, Nov 23, 2011 at 9:07 AM, Altair Linux wrote:

Hi everybody,

I am trying to test this example
http://wiki.videolan.org/LibVLC_SampleCode_SDL but I have these
errors:

g++ TestVLC.cpp -o TestVLC -lSDL

TestVLC.cpp: In function ?void* lock(void*, void**)?:
TestVLC.cpp:30: error: invalid conversion from ?void*? to ?ctx*?
TestVLC.cpp: In function ?void unlock(void*, void*, void* const*)?:
TestVLC.cpp:40: error: invalid conversion from ?void*? to ?ctx*?
TestVLC.cpp:43: error: invalid conversion from ?void*? to ?uint16_t*?

I want to see movies in a SDL_Surface. avi, flc, mp4, etc.

I use Debian stable


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

@malkia, the extension and g++ tool shouldn’t make a difference at all.

Altair, try doing manual casting on those lines; use (void *) and (ctx *)

I hope that helps,
-AlexOn Wed, Nov 23, 2011 at 5:52 AM, Dimiter “malkia” Stanev wrote:

I just took a brief look, and spotted this:

static void *lock (void *data, void **p_pixels) {
struct ctx *ctx = data;

SDL_LockMutex(ctx->mutex);
int pitch = 19203;
SDL_LockTexture(ctx->tex, NULL, p_pixels, &pitch);
return NULL; /
picture identifier, not needed here */
}

The pitch is returned, not provided. “int pitch = 1920*3” is bogus, and
not returning it and handling it later is problematic.

It could be that NONPOT textures are allowed on some platforms, and not on
others (NONPOT - Non Power of Two)

On 11/23/11 12:56 AM, Vittorio Giovara wrote:

I’ve resorted to this implementation, but it is crashing the GL driver
http://bugzilla.libsdl.org/**show_bug.cgi?id=1129http://bugzilla.libsdl.org/show_bug.cgi?id=1129

Any comment or improvement is welcome!
Vittorio

On Wed, Nov 23, 2011 at 9:07 AM, Altair Linux wrote:

Hi everybody,

I am trying to test this example
http://wiki.videolan.org/**LibVLC_SampleCode_SDLhttp://wiki.videolan.org/LibVLC_SampleCode_SDLbut I have these
errors:

g++ TestVLC.cpp -o TestVLC -lSDL

TestVLC.cpp: In function ?void* lock(void*, void**)?:
TestVLC.cpp:30: error: invalid conversion from ?void*? to ?ctx*?
TestVLC.cpp: In function ?void unlock(void*, void*, void* const*)?:
TestVLC.cpp:40: error: invalid conversion from ?void*? to ?ctx*?
TestVLC.cpp:43: error: invalid conversion from ?void*? to ?uint16_t*?

I want to see movies in a SDL_Surface. avi, flc, mp4, etc.

I use Debian stable
_____________**
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_____________**
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

There are two different issue here.

One was compiling, the other one was using some other code that was
crashing on linux, but not on other platforms.

Yes extension matters, as in “C” casting more often are not needed, than
in C++.On 11/23/2011 6:18 AM, Alex Barry wrote:

@malkia, the extension and g++ tool shouldn’t make a difference at all.

Altair, try doing manual casting on those lines; use (void *) and (ctx *)

I hope that helps,
-Alex

On Wed, Nov 23, 2011 at 5:52 AM, Dimiter “malkia” Stanev <@Dimiter_malkia_Stane mailto:Dimiter_malkia_Stane> wrote:

I just took a brief look, and spotted this:

static void *lock (void *data, void **p_pixels) {
    struct ctx *ctx = data;

    SDL_LockMutex(ctx->mutex);
    int pitch = 1920*3;
    SDL_LockTexture(ctx->tex, NULL, p_pixels, &pitch);
    return NULL; /* picture identifier, not needed here */
}

The pitch is returned, not provided. "int pitch = 1920*3" is bogus,
and not returning it and handling it later is problematic.

It could be that NONPOT textures are allowed on some platforms, and
not on others (NONPOT - Non Power of Two)


On 11/23/11 12:56 AM, Vittorio Giovara wrote:

    I've resorted to this implementation, but it is crashing the GL
    driver
    http://bugzilla.libsdl.org/__show_bug.cgi?id=1129
    <http://bugzilla.libsdl.org/show_bug.cgi?id=1129>

    Any comment or improvement is welcome!
    Vittorio

    On Wed, Nov 23, 2011 at 9:07 AM, Altair Linux<altairlinux at gmail.com <mailto:altairlinux at gmail.com>>  wrote:

        Hi everybody,

        I am trying to test this example
        http://wiki.videolan.org/__LibVLC_SampleCode_SDL
        <http://wiki.videolan.org/LibVLC_SampleCode_SDL> but I have
        these
        errors:

        # g++ TestVLC.cpp -o TestVLC -lSDL
        TestVLC.cpp: In function ?void* lock(void*, void**)?:
        TestVLC.cpp:30: error: invalid conversion from ?void*? to ?ctx*?
        TestVLC.cpp: In function ?void unlock(void*, void*, void*
        const*)?:
        TestVLC.cpp:40: error: invalid conversion from ?void*? to ?ctx*?
        TestVLC.cpp:43: error: invalid conversion from ?void*? to
        ?uint16_t*?

        I want to see movies in a SDL_Surface. avi, flc, mp4, etc.

        I use Debian stable
        _________________________________________________
        SDL mailing list
        SDL at lists.libsdl.org <mailto:SDL at lists.libsdl.org>
        http://lists.libsdl.org/__listinfo.cgi/sdl-libsdl.org
        <http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org>


_________________________________________________
SDL mailing list
SDL at lists.libsdl.org <mailto:SDL at lists.libsdl.org>
http://lists.libsdl.org/__listinfo.cgi/sdl-libsdl.org
<http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org>

SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Well, in either c/c++, it’s always best practice to explicitly cast. Also,
instead of doing -lSDL, it may help later down the road to use sdl-config --libs --cflags but I don’t think that’s the issue here.
Maybe adding -Wall to get some additional compiling information.

Also, as malkia pointed out, I believe OpenGL requires a power of 2 sized
texture.

-AlexOn Wed, Nov 23, 2011 at 12:27 PM, Dimiter ‘malkia’ Stanev wrote:

There are two different issue here.

One was compiling, the other one was using some other code that was
crashing on linux, but not on other platforms.

Yes extension matters, as in “C” casting more often are not needed, than
in C++.

On 11/23/2011 6:18 AM, Alex Barry wrote:

@malkia, the extension and g++ tool shouldn’t make a difference at all.

Altair, try doing manual casting on those lines; use (void *) and (ctx *)

I hope that helps,
-Alex

On Wed, Nov 23, 2011 at 5:52 AM, Dimiter “malkia” Stanev <malkia at gmail.com <mailto:malkia at gmail.com>> wrote:

I just took a brief look, and spotted this:

static void *lock (void *data, void **p_pixels) {
struct ctx *ctx = data;

   SDL_LockMutex(ctx->mutex);
   int pitch = 1920*3;
   SDL_LockTexture(ctx->tex, NULL, p_pixels, &pitch);
   return NULL; /* picture identifier, not needed here */

}

The pitch is returned, not provided. “int pitch = 1920*3” is bogus,
and not returning it and handling it later is problematic.

It could be that NONPOT textures are allowed on some platforms, and
not on others (NONPOT - Non Power of Two)

On 11/23/11 12:56 AM, Vittorio Giovara wrote:

   I've resorted to this implementation, but it is crashing the GL
   driver
   http://bugzilla.libsdl.org/__**show_bug.cgi?id=1129<http://bugzilla.libsdl.org/__show_bug.cgi?id=1129>

   <http://bugzilla.libsdl.org/**show_bug.cgi?id=1129<http://bugzilla.libsdl.org/show_bug.cgi?id=1129>
   Any comment or improvement is welcome!
   Vittorio

   On Wed, Nov 23, 2011 at 9:07 AM, Altair Linux<altairlinux at gmail.com <mailto:altairlinux at gmail.com>**> wrote:


       Hi everybody,

       I am trying to test this example
       http://wiki.videolan.org/__**LibVLC_SampleCode_SDL<http://wiki.videolan.org/__LibVLC_SampleCode_SDL>

       <http://wiki.videolan.org/**LibVLC_SampleCode_SDL<http://wiki.videolan.org/LibVLC_SampleCode_SDL>>

but I have
these
errors:

       # g++ TestVLC.cpp -o TestVLC -lSDL
       TestVLC.cpp: In function ?void* lock(void*, void**)?:
       TestVLC.cpp:30: error: invalid conversion from ?void*? to

?ctx*?
TestVLC.cpp: In function ?void unlock(void*, void*, void*
const*)?:
TestVLC.cpp:40: error: invalid conversion from ?void*? to
?ctx*?
TestVLC.cpp:43: error: invalid conversion from ?void*? to
?uint16_t*?

       I want to see movies in a SDL_Surface. avi, flc, mp4, etc.

       I use Debian stable
       ______________________________**___________________
       SDL mailing list
       SDL at lists.libsdl.org <mailto:SDL at lists.libsdl.org>
       http://lists.libsdl.org/__**listinfo.cgi/sdl-libsdl.org<http://lists.libsdl.org/__listinfo.cgi/sdl-libsdl.org>
       <http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.org<http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org>

_________**
SDL mailing list
SDL at lists.libsdl.org <mailto:SDL at lists.libsdl.org>
http://lists.libsdl.org/
**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/__listinfo.cgi/sdl-libsdl.org

<http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_____________**
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_____________**
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Hello again, I have some news.

I change the program to .c and compile with gcc, then runs BUT with a
problem: see the picture, the red arrow shows a black zone. This zone
is not in the FLV file. Note: the video is a TV announce of Nissan, I
see it in YouTube.

http://tinypic.com/r/11bkuax/5

Another problem, my program is in C/C++. I need a example using C++ :confused:

2011/11/23, Alex Barry <alex.barry at gmail.com>:> Well, in either c/c++, it’s always best practice to explicitly cast. Also,

instead of doing -lSDL, it may help later down the road to use sdl-config --libs --cflags but I don’t think that’s the issue here.
Maybe adding -Wall to get some additional compiling information.

Also, as malkia pointed out, I believe OpenGL requires a power of 2 sized
texture.

-Alex

On Wed, Nov 23, 2011 at 12:27 PM, Dimiter ‘malkia’ Stanev wrote:

There are two different issue here.

One was compiling, the other one was using some other code that was
crashing on linux, but not on other platforms.

Yes extension matters, as in “C” casting more often are not needed, than
in C++.

On 11/23/2011 6:18 AM, Alex Barry wrote:

@malkia, the extension and g++ tool shouldn’t make a difference at all.

Altair, try doing manual casting on those lines; use (void *) and (ctx *)

I hope that helps,
-Alex

On Wed, Nov 23, 2011 at 5:52 AM, Dimiter “malkia” Stanev <malkia at gmail.com <mailto:malkia at gmail.com>> wrote:

I just took a brief look, and spotted this:

static void *lock (void *data, void **p_pixels) {
struct ctx *ctx = data;

   SDL_LockMutex(ctx->mutex);
   int pitch = 1920*3;
   SDL_LockTexture(ctx->tex, NULL, p_pixels, &pitch);
   return NULL; /* picture identifier, not needed here */

}

The pitch is returned, not provided. “int pitch = 1920*3” is bogus,
and not returning it and handling it later is problematic.

It could be that NONPOT textures are allowed on some platforms, and
not on others (NONPOT - Non Power of Two)

On 11/23/11 12:56 AM, Vittorio Giovara wrote:

   I've resorted to this implementation, but it is crashing the GL
   driver

http://bugzilla.libsdl.org/__**show_bug.cgi?id=1129http://bugzilla.libsdl.org/__show_bug.cgi?id=1129

<http://bugzilla.libsdl.org/**show_bug.cgi?id=1129http://bugzilla.libsdl.org/show_bug.cgi?id=1129

   Any comment or improvement is welcome!
   Vittorio

   On Wed, Nov 23, 2011 at 9:07 AM, Altair Linux<@Altair_Linux <mailto:@Altair_Linux>**> wrote:


       Hi everybody,

       I am trying to test this example

http://wiki.videolan.org/__**LibVLC_SampleCode_SDLhttp://wiki.videolan.org/__LibVLC_SampleCode_SDL

<http://wiki.videolan.org/**LibVLC_SampleCode_SDLhttp://wiki.videolan.org/LibVLC_SampleCode_SDL>
but I have
these
errors:

       # g++ TestVLC.cpp -o TestVLC -lSDL
       TestVLC.cpp: In function ?void* lock(void*, void**)?:
       TestVLC.cpp:30: error: invalid conversion from ?void*? to

?ctx*?
TestVLC.cpp: In function ?void unlock(void*, void*, void*
const*)?:
TestVLC.cpp:40: error: invalid conversion from ?void*? to
?ctx*?
TestVLC.cpp:43: error: invalid conversion from ?void*? to
?uint16_t*?

       I want to see movies in a SDL_Surface. avi, flc, mp4, etc.

       I use Debian stable
       ______________________________**___________________
       SDL mailing list
       SDL at lists.libsdl.org <mailto:SDL at lists.libsdl.org>

http://lists.libsdl.org/__**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/__listinfo.cgi/sdl-libsdl.org

<http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

___________**
SDL mailing list
SDL at lists.libsdl.org <mailto:SDL at lists.libsdl.org>

http://lists.libsdl.org/__**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/__listinfo.cgi/sdl-libsdl.org

<http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_____________**
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_____________**
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Altair Linux wrote:

Hello again, I have some news.

I change the program to .c and compile with gcc, then runs BUT with a
problem: see the picture, the red arrow shows a black zone. This zone
is not in the FLV file. Note: the video is a TV announce of Nissan, I
see it in YouTube.

http://tinypic.com/r/11bkuax/5

Another problem, my program is in C/C++. I need a example using C++ :confused:

2011/11/23, Alex Barry <alex.barry at gmail.com>:

Well, in either c/c++, it’s always best practice to explicitly cast. Also,
instead of doing -lSDL, it may help later down the road to use sdl-config --libs --cflags but I don’t think that’s the issue here.
Maybe adding -Wall to get some additional compiling information.

Also, as malkia pointed out, I believe OpenGL requires a power of 2 sized
texture.

-Alex

There are two different issue here.

One was compiling, the other one was using some other code that was
crashing on linux, but not on other platforms.

Yes extension matters, as in “C” casting more often are not needed, than
in C++.

@malkia, the extension and g++ tool shouldn’t make a difference at all.

Altair, try doing manual casting on those lines; use (void *) and (ctx *)

I hope that helps,
-Alex

I just took a brief look, and spotted this:

static void *lock (void *data, void **p_pixels) {
struct ctx *ctx = data;

SDL_LockMutex(ctx->mutex);
int pitch = 19203;
SDL_LockTexture(ctx->tex, NULL, p_pixels, &pitch);
return NULL; /
picture identifier, not needed here */
}

The pitch is returned, not provided. “int pitch = 1920*3” is bogus,
and not returning it and handling it later is problematic.

It could be that NONPOT textures are allowed on some platforms, and
not on others (NONPOT - Non Power of Two)

I’ve resorted to this implementation, but it is crashing the GL
driver

http://bugzilla.libsdl.org/__**show_bug.cgi?id=1129http://bugzilla.libsdl.org/__show_bug.cgi?id=1129

<http://bugzilla.libsdl.org/**show_bug.cgi?id=1129http://bugzilla.libsdl.org/show_bug.cgi?id=1129

Any comment or improvement is welcome!
Vittorio

Hi everybody,

I am trying to test this example

http://wiki.videolan.org/__**LibVLC_SampleCode_SDLhttp://wiki.videolan.org/__LibVLC_SampleCode_SDL

<http://wiki.videolan.org/**LibVLC_SampleCode_SDLhttp://wiki.videolan.org/LibVLC_SampleCode_SDL>
but I have
these
errors:

g++ TestVLC.cpp -o TestVLC -lSDL

TestVLC.cpp: In function ?void* lock(void*, void**)?:
TestVLC.cpp:30: error: invalid conversion from ?void*? to
?ctx*?
TestVLC.cpp: In function ?void unlock(void*, void*, void*
const*)?:
TestVLC.cpp:40: error: invalid conversion from ?void*? to
?ctx*?
TestVLC.cpp:43: error: invalid conversion from ?void*? to
?uint16_t*?

I want to see movies in a SDL_Surface. avi, flc, mp4, etc.

I use Debian stable
___________**
SDL mailing list
SDL at lists.libsdl.org <mailto:SDL at lists.libsdl.org>

http://lists.libsdl.org/__**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/__listinfo.cgi/sdl-libsdl.org

<http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

___________**
SDL mailing list
SDL at lists.libsdl.org <mailto:SDL at lists.libsdl.org>

http://lists.libsdl.org/__**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/__listinfo.cgi/sdl-libsdl.org

<http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_____________**
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_____________**
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
If I remember correctly, it’s the example code that draws that box there (function unlock in the example in the VLC website):
http://wiki.videolan.org/LibVLC_SampleCode_SDL> > On Wed, Nov 23, 2011 at 12:27 PM, Dimiter ‘malkia’ Stanev wrote:

On 11/23/2011 6:18 AM, Alex Barry wrote:

On Wed, Nov 23, 2011 at 5:52 AM, Dimiter “malkia” Stanev <malkia at gmail.com <mailto:malkia at gmail.com>> wrote:
On 11/23/11 12:56 AM, Vittorio Giovara wrote:
On Wed, Nov 23, 2011 at 9:07 AM, Altair Linux<altairlinux at gmail.com <mailto:altairlinux at gmail.com>**> wrote: