[PATCH] RFC: CrystalHD decoder support
Hi all, For the past few weeks, I've been attempting to implement CrystalHD decoder support, first directly in ffmpeg and then in mplayer - and I'll touch on why that is in a moment. The current patch is largely functional with a few important caveats: * It doesn't work properly with the 70012 hardware. I did all my development against a 70015 and haven't really paid any attention to the 70012. It will run but it performs terribly for some reason. * Interlaced frames are not handled very well - it kinda works but av-sync is a mess. * Files with resolutions above 720p probably won't play properly due to not being able to get data in and out of the decoder fast enough. Broadcom state in the driver/lib source that you need separate input and output threads to keep it fed and I'm not sure how to reconcile that with the mplayer/ffmpeg API (I assume ffmpeg-mt could do this). However, the biggest issue is that the decoder breaks an assumption in mplayer about how many calls to decode can occur before a frame is returned. At the start up, the crystalhd might require 20 or more calls before it ever returns a frame, and without increasing the maximum number of buffered_pts, it will start discarding them, ensuring that av-sync goes out the window. So, I've bumped max buffered_pts to 128 in this patch - 64 was too low, but it might need to be even higher for 1080p content. I'm also not sure how QUERY_UNSEEN_FRAMES should be used. I don't know how many complete frames are in the decoder waiting to be decoded and mplayer seems to be comparing the result with buffered_pts which comes from the pts passed to each decode call, so I'm pretty confused. It also doesn't help with vd_ffmpeg adding 10 and then having it subtracted later. So I ended up returning 20 + the number of decode calls that haven't returned a frame since the last flush. It seems to work but it's hardly scientific. With that in place, progressive <= 720p content plays well - with a note that I have to force lavf to demux avi and wmv files correctly. The native demuxers dont' sync properly - i think because they also make assumptions about how long you have to wait for frames to come back. I'm not sure what's going on with interlacing. xbmc does line-doubling on each field and the gstreamer plugin doesn't handle it at all so I had to guess, and while I can construct a frame that de-interlacing filters are happy with, av-sync goes way out the window; NTSC content plays at not-quite half rate (if I force 59.94, it plays slightly too fast), etc. Now, why an mplayer plugin? I originally wrote this as an ffmpeg hwaccel on top of Gwenole's v2 patch with some additions to support accelerating decode_frame as opposed to decode_slice and it kinda worked but most of my h.264 streams would make the crystalhd grumpy (those play fine with the mplayer plugin). There's also no real benefit in terms of code sharing as the only place we need codec awareness is the sps/pps decoding and ffmpeg's h.264 codec doesn't build up a compatible struct anyway. I also had a problem where I just got solid grey output with x11/xv (but correct frames with vdpau). So, combining all that with wanting to debug the sync problems as directly as possible, I switched to an mplayer plugin and everything worked much better. Philosophically, I think it can be argued either way; you can consider libcrystalhd to be a library codec like theora or xvid and say it's a valid mplayer codec on that basis, or you can argue that it's an accelerator that should be usable from ffmpeg (although the advantages for a transcode job are going to be very marginal). At this point, I'm not seriously suggesting it's ready to go in - the interlaced handling needs to get sorted out and I think we need a more rigorous basis for how the av sync interactions are done; still I'm sure some people will be very happy to see mplayer finally using this hardware. --phil
2010/12/20 Philip Langdale <mplayer.philipl@overt.org>: Hi,
For the past few weeks, I've been attempting to implement CrystalHD decoder support,
That's nice and welcomed !
* It doesn't work properly with the 70012 hardware. I did all my development against a 70015 and haven't really paid any attention to the 70012.
FYI, I had a BCM70012 which never worked out that well (in gst-crystalhd). I just bought a BCM70015 that does wonder. So I'm starting considering it's the 70012 itself (or its firmware) that is actually bugged.
At this point, I'm not seriously suggesting it's ready to go in - the interlaced handling needs to get sorted out and I think we need a more rigorous basis for how the av sync interactions are done; still I'm sure some people will be very happy to see mplayer finally using this hardware.
Haven't looked at the patch yet but I'll give it a try by tonight if possible. FYI, VLC just added CrystalHD support very recently (or at least a patch is 2-3 weeks old on mailing list), if you need something else to compare with (other than gst). Ben
On Sun, Dec 19, 2010 at 06:50:04PM -0700, Philip Langdale wrote:
However, the biggest issue is that the decoder breaks an assumption in mplayer about how many calls to decode can occur before a frame is returned. At the start up, the crystalhd might require 20 or more calls before it ever returns a frame, and without increasing the maximum number of buffered_pts, it will start discarding them, ensuring that av-sync goes out the window.
Really? That amount of buffered frames would mean this hardware is completely useless for video telephone or any other interactive application.
So, I've bumped max buffered_pts to 128 in this patch - 64 was too low, but it might need to be even higher for 1080p content.
This is more than 4 seconds, you are going to run into _serious_ issues, with that, e.g. if combined with uncompressed multichannel PCM audio 4 seconds is probably more than MPlayer will be able to buffer, causing playback to fail.
I'm also not sure how QUERY_UNSEEN_FRAMES should be used. I don't know how many complete frames are in the decoder waiting to be decoded
Why don't you know that? At least for the non-interlaced, non-error-concealment case it should be just a matter of "number of packets in - number of frames out".
and mplayer seems to be comparing the result with buffered_pts which comes from the pts passed to each decode call, so I'm pretty confused.
Figure out how timestamp reordering is supposed to be done, then the right solution should become more obvious. Unless of course they went the cheap way and don't have any way to figure out with input time stamp belongs to which output frame, in which case that solution would become completely useless for any variable frame-rate content...
It also doesn't help with vd_ffmpeg adding 10 and then having it subtracted later. So I ended up returning 20 + the number of decode calls that haven't returned a frame since the last flush. It seems to work but it's hardly scientific.
A too large value will work most of the time, but is likely to cause issues with timestamp wraps.
With that in place, progressive <= 720p content plays well - with a note that I have to force lavf to demux avi and wmv files correctly. The native demuxers dont' sync properly - i think because they also make assumptions about how long you have to wait for frames to come back.
demuxers aren't concerned with what comes after. Take a look at mpi_no_picture in vd_ffmpeg.c, it's likely you have to do something like that (though actually that should only really apply to the interlaced case you mention below). Hm, I just saw you actually use that, but I have some doubts if it is correct to use it for the ReadyListCount case. And the behaviour of the native demuxers and lavf should behave the same if you use -nocorrect-pts.
There's also no real benefit in terms of code sharing as the only place we need codec awareness is the sps/pps decoding and ffmpeg's h.264 codec doesn't build up a compatible struct anyway.
The point would be to have code sharing with e.g. VLC, at least in the long run. There is not enough manpower available in the MPlayer project to maintain this, I guarantee you that the moment you don't actively look after it it will bit-rot and become unusable in no time, while in the process probably wasting a good bit of mine and other's time.
Philosophically, I think it can be argued either way; you can consider libcrystalhd to be a library codec like theora or xvid and say it's a valid mplayer codec on that basis,
No, it is not anymore. FFmpeg is the only valid place to add codec support, no matter what.
--- a/Makefile +++ b/Makefile @@ -330,6 +330,8 @@ SRCS_COMMON-$(XMMS_PLUGINS) += libmpdemux/demux_xmms.c SRCS_COMMON-$(XVID4) += libmpcodecs/vd_xvid4.c SRCS_COMMON-$(ZR) += libmpcodecs/vd_zrmjpeg.c \ libmpcodecs/vf_zrmjpeg.c +SRCS_COMMON-$(CRYSTALHD) += libmpcodecs/vd_crystalhd.c +
That is not quite where the letter "c" goes in my alphabet...
@@ -7023,6 +7027,21 @@ else fi echores "$_libdv"
+echocheck "CrystalHD" +if test "$_crystalhd" = auto ; then + _crystalhd=no + statement_check_broken libcrystalhd/bc_dts_types.h libcrystalhd/libcrystalhd_if.h 'DtsGetVersion(0, 0, 0)' -lcrystalhd $_ld_lm && _crystalhd=yes
Can they be convinced to fix their header instead?
/* Please do not add any new decoders here. If you want to implement a new * decoder, add it to libavcodec, except for wrappers around external * libraries and decoders requiring binary support. */
Ah, ok, that is where your interpretation came from. I guess it is time to remove the wrapper exception, or at least reduce it to "trivial wrappers".
+ * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version.
With regards to FFmpeg integration a LGPL version would be preferable.
+ * fast_memcpy: From libcrystalhd
MPlayer already has a fast_memcpy function (two actually, depending on whether the source/target is normal memory or a memory-mapped device). And in difference to this variant using intrinsics it 1) will have predictable performance (yes, compilers still sometimes compile intrinsics in a way that negates any speed advantage) 2) it actually compiles on older compilers
+ uint8_t *data = extradata; + uint32_t data_size = extradata_size;
I fail to see what these are needed for.
+ if(*(char *)extradata == 1) {
Same for that cast/
+ priv->nal_length_size = ((*(((char*)(data))+4))&0x03)+1;
And this should be written in a way that doesn't look worse than LISP.
+ profile = (data[1] << 16) | (data[2] << 8) | data[3];
AV_RB24
+ nal_size = (data[0] << 8) | data[1];
AV_RB16
+ return priv->is_avc ? BC_MSUBTYPE_AVC1 : BC_MSUBTYPE_H264;
AVC1? Worst naming ever. Nothing you can do about that though, except adding a comment what they actually mean by that. And of course not name your variable is_avc, this is bytestream (aka Annex B) vs. NAL (aka mp4) format.
+ if (((((uintptr_t) dst) & 0xf) == 0) && ((((uintptr_t) src) & 0xf) == 0)) + { + while (count >= (16*4))
Wow, why not add a few () more, I'm sure it's possible to make it completely unreadable...
+ int format =(*((int *)arg));
= *(int *)arg; works just fine, it's not like there's even the remotest possibility to evaluate that in any other order...
+ Priv* priv;
Tab.
+ switch(sh->codec->outfmt[sh->outfmtidx]){ + case IMGFMT_YUY2: + break; + default: + mp_msg(MSGT_DECVIDEO, MSGL_V, "Unsupported out_fmt: 0x%X\n", + sh->codec->outfmt[sh->outfmtidx]); + return 0; + }
Pointless, query_format already checks that the format is supported. Also, why only IMGFMT_YUY2? That wastes a huge amount of bandwidth (unless the input is actual 4:2:2 - if the is even supported).
+ /* Gather some information about the host library */ + /* Initialize the library */
More tabs.
+ priv->is_avc = extradata_size > 0 ? (*(char *)extradata == 1) : 0;
extradata_size > 0 && *extradata == 1;
+ format.height = sh->disp_h; + if (format.height == 1088) { + format.height = 1080; + }
That certainly isn't correct.
+ ret = DtsSetInputFormat(priv->dev, &format); + if (ret != BC_STS_SUCCESS) { + mp_msg(MSGT_DECVIDEO, MSGL_V, "CrystalHD: SetInputFormat failed\n"); + return 0; + }
Shouldn't you do some stuff like closing the device and freeing some stuff in all those error cases?
+ ret = DtsSetColorSpace(priv->dev, OUTPUT_MODE422_YUY2);
Probably worst possible choice of output color format, it is not compact (16 bpp vs. 12 bpp), it is not the final format (that will usually be RGB), it is not supported by all vos (e.g. with -vo gl that will always imply a software colorspace conversion), and it will involve chroma interpolation on the device - chances are good it's bad if not outright broken.
+ free(priv->sps_pps_buf); + free(priv); +static mp_image_t* decode(sh_video_t *sh, void* data, int len, int flags) + BC_STATUS ret; + BC_DTS_PROC_OUT output;
Inconsistent indentation, inconsistent placement of *
+ if (flags != 0) { + if (len != 0) {
The != 0 is fairly redundant
+ /* + * No frames ready. Don't try to extract. + */ + if (decoder_status.ReadyListCount == 0) { + usleep(1000);
Sleeping in the decoder is going to be rather suboptimal.
+ sh->disp_h = output.PicInfo.height; + if (output.PicInfo.height == 1088) { + sh->disp_h = 1080; + }
This is still just broken. You will probably want the cropped dimensions. However if the hardware does not support cropping on its own there's going to be a lot of issues.
+ interlaced = (output.PicInfo.flags & VDEC_FLAG_INTERLACED_SRC);// && + //!(output.PicInfo.flags & VDEC_FLAG_UNKNOWN_SRC); + top_field = (output.PicInfo.flags & VDEC_FLAG_TOPFIELD) == VDEC_FLAG_TOPFIELD; + bottom_field = (output.PicInfo.flags & VDEC_FLAG_BOTTOMFIELD) == VDEC_FLAG_BOTTOMFIELD;
I have quite some doubts about this. The obvious one is: Why is the API designed in a way that you can end up with the two top_field == bottom_field cases and what are they supposed to mean. The less obvious one is: what exactly does interlaced mean? There is PAFF coding, there is MBAFF coding and then interlaced can be coded as progressive (even if it is a bad idea), what exactly does this one indicate (I have a suspicion that it actually mean PAFF).
+ for (sY = 0; sY < height; dY++, sY++) { + fast_memcpy(&(dst[dY * dStride]), &(src[sY * width]), width); + if (interlaced) { + dY++; + } + }
I suspect that memcpy_pic is going to solve this easier. Still, a memcpy is not exactly fast at high resolutions.
On 2010-12-20 19:15:13, Reimar Döffinger wrote:
Really? That amount of buffered frames would mean this hardware is completely useless for video telephone or any other interactive application.
It seems ridiculous but I have not been able to convince it to give me a decoded frame without shoving more data into it - no matter how long I wait.
This is more than 4 seconds, you are going to run into _serious_ issues, with that, e.g. if combined with uncompressed multichannel PCM audio 4 seconds is probably more than MPlayer will be able to buffer, causing playback to fail.
Highly likely :-/
I'm also not sure how QUERY_UNSEEN_FRAMES should be used. I don't know how many complete frames are in the decoder waiting to be decoded
Why don't you know that? At least for the non-interlaced, non-error-concealment case it should be just a matter of "number of packets in - number of frames out".
and mplayer seems to be comparing the result with buffered_pts which comes from the pts passed to each decode call, so I'm pretty confused.
Figure out how timestamp reordering is supposed to be done, then the right solution should become more obvious. Unless of course they went the cheap way and don't have any way to figure out with input time stamp belongs to which output frame, in which case that solution would become completely useless for any variable frame-rate content...
So, It wasn't clear to me that I could assume every call to decode gave me a complete encoded frame (as opposed to just a bunch of bytes) but it seems clear that is true. Unfortunately, the current crystalhd code will not return timestamps on decoded frames. It's supposed to support passing in a pts to the input function and having it come back on the output but this seems to only work with 70012 hardware. So yes, I am screwed in that regard.
A too large value will work most of the time, but is likely to cause issues with timestamp wraps.
Ok - well, I can now shrink this down to the real value but it may still be large enough to cause problems.
demuxers aren't concerned with what comes after. Take a look at mpi_no_picture in vd_ffmpeg.c, it's likely you have to do something like that (though actually that should only really apply to the interlaced case you mention below). Hm, I just saw you actually use that, but I have some doubts if it is correct to use it for the ReadyListCount case. And the behaviour of the native demuxers and lavf should behave the same if you use -nocorrect-pts.
I actually thought I removed it from the ReadyListCount case - I will get rid of that.
The point would be to have code sharing with e.g. VLC, at least in the long run. There is not enough manpower available in the MPlayer project to maintain this, I guarantee you that the moment you don't actively look after it it will bit-rot and become unusable in no time, while in the process probably wasting a good bit of mine and other's time.
Understood. Once I've got the other problems sorted out in the mplayer context, I will look at pushing it down - but we'll definitely need to change how vd_ffmpeg does QUERY_UNSEEN_FRAMES as part of that.
That is not quite where the letter "c" goes in my alphabet...
Will fix.
Can they be convinced to fix their header instead?
It would be nice. Apparently this was fallout from a change to avoid that types header getting pulled into kernel driver builds. Jarod hasn't been responsive to any of my emails so far, so we'll have to see.
With regards to FFmpeg integration a LGPL version would be preferable.
No problem on my part.
MPlayer already has a fast_memcpy function (two actually, depending on whether the source/target is normal memory or a memory-mapped device). And in difference to this variant using intrinsics it 1) will have predictable performance (yes, compilers still sometimes compile intrinsics in a way that negates any speed advantage) 2) it actually compiles on older compilers
Ok, I'll use that.
<A number of comments on SPS/PPS decoding>
I took this function as-is from xbmc so I can't take credit for the code style. I'll rework it to address your comments.
Pointless, query_format already checks that the format is supported. Also, why only IMGFMT_YUY2? That wastes a huge amount of bandwidth (unless the input is actual 4:2:2 - if the is even supported).
Cute isn't it? The 70015 only outputs YUY2 - even though it only supports 420 input. The 70012 can apparently output YV12/NV12. *sigh*. So I had the QUERY_FORMAT handling there with an eye to supporting YV12 on the 70012 and then you need the dynamic check, but all the other implementations seem to have given up and use YUY2 on both decoders. :-/
+ format.height = sh->disp_h; + if (format.height == 1088) { + format.height = 1080; + }
That certainly isn't correct.
I need to investigate this more - the logic came from xbmc. Certainly if I feed it a stream where the raw metadata says 1088, it doesn't automatically crop to 1080 on output.
Shouldn't you do some stuff like closing the device and freeing some stuff in all those error cases?
Yes, I should.
I have quite some doubts about this. The obvious one is: Why is the API designed in a way that you can end up with the two top_field == bottom_field cases and what are they supposed to mean. The less obvious one is: what exactly does interlaced mean? There is PAFF coding, there is MBAFF coding and then interlaced can be coded as progressive (even if it is a bad idea), what exactly does this one indicate (I have a suspicion that it actually mean PAFF).
I think that libcrystalhd is buggy with respect to setting these flags - at least on 70015. But it's resulted in some very strange values in my tests. I haven't had a chance to run through the samples in the ffmpeg collection to fully establish what the behaviour is in each of the three cases. I've tested on mpeg2 interlaced and an h.264 stream where I'm not sure what the real encoding is - all I know is I get full frames comprised of interlaced fields and some frames are marked progressive and others are marked as top fields (and then I get three top fields in a row...)
I suspect that memcpy_pic is going to solve this easier. Still, a memcpy is not exactly fast at high resolutions.
No, and it's probably a big part of why this thing requires quite a lot of work to get it to decode 1080p in real time (sad). Thanks for all the comments. I will address them and post an updated diff, probably this weekend. As I mentioned above, I'm not going to move it to ffmpeg until I've got it working properly - it's easier to debug the mplayer interactions in a native codec. Thanks! --phil
On 2010-12-20 8:34:29, Benjamin Zores wrote:
FYI, I had a BCM70012 which never worked out that well (in gst-crystalhd). I just bought a BCM70015 that does wonder. So I'm starting considering it's the 70012 itself (or its firmware) that is actually bugged.
I actually got my 70012 to work well with gstbcmdec after one of the more significant updates to the driver/lib so I think it can be made to work, but certainly my current code is not treating it well. I would not be surprised to hear that the vlc patch has similar problems.
Haven't looked at the patch yet but I'll give it a try by tonight if possible.
FYI, VLC just added CrystalHD support very recently (or at least a patch is 2-3 weeks old on mailing list), if you need something else to compare with (other than gst).
Thanks for the heads up, I took a look and it's conceptually the same; but it doesn't touch interlacing at all, and I suspect that if vlc actually uses output timestamps, things will go south fast on a 70015 as that fails to return them with the decoded frames (as mentioned in my reply to Reimar. I do intend to move this to an ffmpeg codec once I've dealt with the major problems and hopefully vlc can share that. --phil
On Sun, Dec 19, 2010 at 06:50:04PM -0700, Philip Langdale wrote:
--- a/Makefile +++ b/Makefile @@ -330,6 +330,8 @@ SRCS_COMMON-$(XMMS_PLUGINS) += libmpdemux/demux_xmms.c SRCS_COMMON-$(XVID4) += libmpcodecs/vd_xvid4.c SRCS_COMMON-$(ZR) += libmpcodecs/vd_zrmjpeg.c \ libmpcodecs/vf_zrmjpeg.c +SRCS_COMMON-$(CRYSTALHD) += libmpcodecs/vd_crystalhd.c +
alphabetical order please
--- a/configure +++ b/configure @@ -8212,6 +8231,7 @@ XVMC = $_xvmc XVR100 = $_xvr100 YUV4MPEG = $_yuv4mpeg ZR = $_zr +CRYSTALHD = $_crystalhd
same here
@@ -8498,6 +8518,7 @@ $def_vorbis $def_x264 $def_xvid $def_zlib +$def_crystalhd
and here
--- /dev/null +++ b/libmpcodecs/vd_crystalhd.c @@ -0,0 +1,609 @@ +/* + * - CrystalHD decoder module for mplayer/mencoder -
It's pointless to note this is for MPlayer/MEncoder.
+ * Copyright(C) 2010 Philip Langdale <mplayer.philipl@overt.org> + * + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Credits: + * fast_memcpy: From libcrystalhd + * extract_sps_pps_from_avcc: from xbmc
Please place the credits above the license boilerplate.
+typedef struct { +} Priv;
Gah, typedefs and uppercased names...
+static mp_image_t mpi_no_picture = +{ + .type = MP_IMGTYPE_INCOMPLETE +};
Please use K&R style, 4 space indentation, no tabs.
+static int extract_sps_pps_from_avcc(Priv *priv, uint8_t *extradata, uint32_t extradata_size)
Please keep lines below 80 characters where easily possible.
+static uint8_t name2subtype(Priv *priv, const char *name) +{ + if (strcmp(name, "chddivx") == 0) { + return BC_MSUBTYPE_DIVX; + } else if (strcmp(name, "chddivx3") == 0) { + return BC_MSUBTYPE_DIVX311; + } else if (strcmp(name, "chdmpeg1") == 0) { + return BC_MSUBTYPE_MPEG1VIDEO; + } else if (strcmp(name, "chdmpeg2") == 0) { + return BC_MSUBTYPE_MPEG2VIDEO; + } else if (strcmp(name, "chdvc1") == 0) { + return BC_MSUBTYPE_VC1; + } else if (strcmp(name, "chdwvc1") == 0) { + return BC_MSUBTYPE_WVC1; + } else if (strcmp(name, "chdwmv3") == 0) { + return BC_MSUBTYPE_WMV3; + } else if (strcmp(name, "chdwmva") == 0) { + return BC_MSUBTYPE_WMVA; + } else if (strcmp(name, "chdh264") == 0) { + return priv->is_avc ? BC_MSUBTYPE_AVC1 : BC_MSUBTYPE_H264; + } else { + return BC_MSUBTYPE_INVALID;
switch? Diego
On Wed, Dec 22, 2010 at 01:31:40PM +0100, Diego Biurrun wrote:
+static uint8_t name2subtype(Priv *priv, const char *name) +{ + if (strcmp(name, "chddivx") == 0) { + return BC_MSUBTYPE_DIVX; + } else if (strcmp(name, "chddivx3") == 0) { + return BC_MSUBTYPE_DIVX311; + } else if (strcmp(name, "chdmpeg1") == 0) { + return BC_MSUBTYPE_MPEG1VIDEO; + } else if (strcmp(name, "chdmpeg2") == 0) { + return BC_MSUBTYPE_MPEG2VIDEO; + } else if (strcmp(name, "chdvc1") == 0) { + return BC_MSUBTYPE_VC1; + } else if (strcmp(name, "chdwvc1") == 0) { + return BC_MSUBTYPE_WVC1; + } else if (strcmp(name, "chdwmv3") == 0) { + return BC_MSUBTYPE_WMV3; + } else if (strcmp(name, "chdwmva") == 0) { + return BC_MSUBTYPE_WMVA; + } else if (strcmp(name, "chdh264") == 0) { + return priv->is_avc ? BC_MSUBTYPE_AVC1 : BC_MSUBTYPE_H264; + } else { + return BC_MSUBTYPE_INVALID;
switch?
Uh, C does not have a switch for strings. An array lookup would be possible, but not sure if that's a good idea.
On Sun, Dec 19, 2010 at 06:50:04PM -0700, Philip Langdale wrote:
@@ -9,6 +9,135 @@ release 20101127 ; VIDEO CODECS ;=============================================================================
+videocodec chdh264 + info "CrystalHD H.264" + status working + fourcc H264,h264 + fourcc X264,x264 + fourcc avc1,AVC1 + fourcc davc,DAVC + fourcc vvvc ; only one sample using this fourcc + format 0x10000005 + driver crystalhd + dll crystalhd + out YUY2 + +videocodec chdmpeg1 + info "CrystalHD MPEG-1" + status working + format 0x10000001 ; MPEG-1 + fourcc mpg1 + fourcc PIM1 ; Pinnacle hardware-MPEG-1 + fourcc VCR2 + fourcc MPEG + fourcc m1v1 + driver crystalhd + dll crystalhd + out YUY2
If you are porting it to FFmpeg that is pretty much irrelevant, but I just realize that you are using the "videcodec" name to decide which decoder to use. That is a bad idea, since that is user-visible and we should be able to change that without changing program behaviour. You should instead change the "dll" as it is done for all FFmpeg decoders for example.
On Wed, 22 Dec 2010 14:04:44 +0100 Reimar Döffinger <Reimar.Doeffinger@gmx.de> wrote:
If you are porting it to FFmpeg that is pretty much irrelevant, but I just realize that you are using the "videcodec" name to decide which decoder to use. That is a bad idea, since that is user-visible and we should be able to change that without changing program behaviour. You should instead change the "dll" as it is done for all FFmpeg decoders for example.
Yes, I guess it's irrelevant in the grand scheme of things, but I've made the change in my local tree. Jarod was nice enough to point me to the crystalhd-development list; I'm going to be working with them to try and sort out the fundamental problems and then I'll post an updated patch here; it'll probably be past the weekend, but I wanted to make clear I'm not giving up :-) I'll also address Diego's comments too. Thanks! --phil
On Wed, 22 Dec 2010 14:04:44 +0100 Reimar Döffinger <Reimar.Doeffinger@gmx.de> wrote:
If you are porting it to FFmpeg that is pretty much irrelevant, but I just realize that you are using the "videcodec" name to decide which decoder to use. That is a bad idea, since that is user-visible and we should be able to change that without changing program behaviour. You should instead change the "dll" as it is done for all FFmpeg decoders for example.
Yes, I guess it's irrelevant in the grand scheme of things, but I've made the change in my local tree. Jarod was nice enough to point me to the crystalhd-development list; I'm going to be working with them to try and sort out the fundamental problems and then I'll post an updated patch here; it'll probably be past the weekend, but I wanted to make clear I'm not giving up :-) I'll also address Diego's comments too. Thanks! --phil
participants (5)
-
Benjamin Zores -
Diego Biurrun -
Philip Langdale -
Philip Langdale -
Reimar Döffinger