1

I am trying to write a small program in C++ that transcodes a video frame by frame, and I am using the functions libvlc_video_set_callbacks and libvlc_video_set_format_callbacks to achieve this.

The first function works fine, but I am not sure how to implement libvlc_video_set_format_callbacks.

I tried it this way to start with but it gives me an argument error for 'setup':

int setup(void* pUserData, char *chroma, unsigned int *width, unsigned int *height, unsigned int *pitches, unsigned int *lines)
    {
        (void) pUserData;
        return 1;
    }

libvlc_video_set_format_callbacks(mp, setup, cleanup);

Next thing is that I don't really know how to set the right video format properties.

Can you please help me with this setup-function or at least point me to an example that shows how to implement it, as I didn't find one? As you can imagine, I am not a very experienced programmer so please be patient with me ;) Thanks in advance

user2273364
  • 65
  • 1
  • 7

1 Answers1

0

liblv_video_set_format_callbacks second argument is of type libvlc_video_format_cb, which is the following typedef:

typedef unsigned(* libvlc_video_format_cb)(void **opaque, char *chroma, unsigned *width, unsigned *height, unsigned *pitches, unsigned *lines);

We can see two differences with your setup function:

  • The type of the first argument should be void**. Yours is void*.
  • The return type should be unsigned. Yours is int.

I don't know either about video format properties. Thus, I will not able to give you any pointers for that.

Morwenn
  • 21,684
  • 12
  • 93
  • 152
  • I already had `unsigned`, don't know why I changed it to `int`.. but I must have overlooked the second `*`. So thanks for your reply! Now I'm trying to set the video format properties, but I guess this is the more complex part of my question.. – user2273364 Apr 22 '13 at 14:09
  • @user2273364 I guess too. By the way, you should make it be another question. It is better to ask questions step by step that multiple questions at once. Only a few people will be able to answer all the questions, but many more can resolve one step or another :) – Morwenn Apr 22 '13 at 14:12