tnctvl / google-gdata

Automatically exported from code.google.com/p/google-gdata
0 stars 0 forks source link

YouTubeQuery VideoFormat in c# doesn't match the c library #553

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If you look at the code the enum in c# is:

public enum VideoFormat
{
    FormatUndefined,
    RTSP,
    Embeddable,
    Mobile,
}

(in c)
typedef enum {
    GDATA_YOUTUBE_FORMAT_UNKNOWN = 0,
    GDATA_YOUTUBE_FORMAT_RTSP_H263_AMR = 1,
    GDATA_YOUTUBE_FORMAT_HTTP_SWF = 5,
    GDATA_YOUTUBE_FORMAT_RTSP_MPEG4_AAC = 6
} GDataYouTubeFormat;

----------------------
so, when doing something like this:

int flv = (int)YouTubeQuery.VideoFormat.Embeddable;

flv gets set to 2 instead of 5.
----------------------

Should the c# code be this?

public enum VideoFormat
{
    FormatUndefined = 0,
    RTSP = 1,
    Embeddable = 5,
    Mobile = 6,
}

Original issue reported on code.google.com by ss...@decriptor.com on 2 Nov 2011 at 7:47

GoogleCodeExporter commented 8 years ago
The appropriate conversions to/from int are performed in the CalculateQuery and 
ParseUri methods.

However, I agree that the C# code you suggest will simplify that logic.
Thanks for the suggestion, I'll have that included in one of the future 
releases.

Original comment by ccherub...@google.com on 2 Nov 2011 at 10:02

GoogleCodeExporter commented 8 years ago

Original comment by ccherub...@google.com on 2 Nov 2011 at 10:03

GoogleCodeExporter commented 8 years ago
This has been fixed in rev. 1141.

Original comment by ccherub...@google.com on 3 Nov 2011 at 11:17