Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6627215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:59:13+00:00 2026-05-25T21:59:13+00:00

My code is very straightforward; it consumes YUV420P data, resizes it, and produces a

  • 0

My code is very straightforward; it consumes YUV420P data, resizes it, and produces a PNG or JPEG image (OS X Lion, Apple’s gcc 4.2.1). It works fine; I’m using ffmpeg (HEAD, as of mumble days ago), but when running in -pedantic-errors mode (which I like to do from time to time):

zc_libav.c:30: error: passing argument 2 of ‘sws_scale’ from incompatible pointer type

Ouch! Well, what’s my code look like?

sws_scale(sws_ctx, 
          in_pic->data,
          in_pic->linesize, 
          0, 
          in->y, 
          out_pic->data, 
          out_pic->linesize); 

(You can assume for the sake of argument that the in_pic and out_pic AVPicture structures have been properly initialized, as the code works).

Well, what’re the offending data types?

from libswscale/swscale.h:

int sws_scale(struct SwsContext *c, const uint8_t* const srcSlice[], …

from libavcodec/avcodec.h

typedef struct AVPicture {
  uint8_t *data[4];
  int linesize[4];       ///< number of bytes per line
} AVPicture;

As I noted above, when I change -pedantic-errors to -pedantic, I get the same complaint, but the code compiles and runs correctly. For my own neurotic sanity, is there any way to get the advantages of -pedantic-errors and, you know, compile this code?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:59:13+00:00Added an answer on May 25, 2026 at 9:59 pm

    This would be ok in C++, but C doesn’t have the same rules regarding const. It doesn’t like that you are passing a non-const uint8_t ** to a function that takes a const uint8_t *const *.

    In C, you can convert an X * to a const X *, but it only works for one pointer level. The next pointer level has to match exactly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

function classInfo(e){ document.getElementById('classRight').setAttribute('display','none'); alert(e); } I think this code is very straightforward bit it's
I have no idea why this is happening. I have some very straightforward code,
I'll try and keep my sample code very straightforward, but it may have errors
I have a piece of code VERY similar to this one http://java.sun.com/developer/onlineTraining/JavaMail/contents.html#JavaMailFetching I the
I'm finding this kind of overriding after a new in java code very often
Currently, each td../td prints in just 1 line which makes the source code very
The below code is very simple. I have a jQuery autocomplete bound to an
The source code looks very similar: pump , pipe . Why would I use
I have the following line of code called very often: var configValue = System.Configuration.ConfigurationManager.AppSettings[ConfigValueKey];
My issue is with a certain style of code that very much resembles recursion,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.