IRC Log Viewer » #firebreath » 2011-07-23

IRC Nick Time (GMT-7) Message
someone-noone 04:07 hello!
jshanab_wcw 09:07 someome-noone. good morning. Sounds like you made a lot of progress on your video player!
someone-noone 09:07 jshanab_wcw: yeap, but i did it in another way i wanted, but everthing is good
the main problem is yuv 2 rgba conversation, but it can be done on shader or using fast algorithm that taxilian offered
so i will do it later and now i'm focusing on another functions
today i've completed multiple-plugins-on-window support and nearly completed pause\unpause.
jshanab_wcw 09:07 Awsome. It took me a lot longer. Live and Files from our own existing server
Now if i can just solve my DirectX error on intel 3150 cards
someone-noone 09:07 do you still use sdl 1.3?
jshanab_wcw 09:07 Ripped it out for now. Could not get it to not crash :-(
I have multiple live views of security cameras in a single page, if i am running FF and start IE at the same time it crashes. If i start IE first i am ok. Then if I go to a single and come back to multi-camera view it again crashes. Al of these are access violations inside the SDL_Init()
jshanab_wcw 09:07 And I solved one but found another with the Intel GMA 3150. FYI supports directX 9.0c Fine print Software only vertex processing! Real problem is I can only display 5 videos, then it returns null for surface locked rectangle
someone-noone 09:07 hm
i'm using SDL 1.2 + SDL_mixer on mac. But without processing video, only audio.
jshanab_wcw 09:07 This is a really really low end card. I may have to write it such that multiple videos paint to one canvas. Kinda messes up the whole mimetype system
1.2 is more stabel, but if you do video and use the yuv textures, it is on 1 single overlay only.
someone-noone 09:07 You know, i think i will do on windows the same way i've done on mac: i will convert all data to rgba and draw in a manual way
there should be no problems for drawing rgba on any system
and another subsystem of my plugin will do fast convertion from yuv2rgba
i think directx, opengl , sdl and etc. ways are wrong
because they was designed to make our task easy, but there are a lot of things we should to understand...and see crash by crash...
so i found this way easier
don't know, may be it is suitable for you too
jshanab_wcw 10:07 Will work for single video. I do that for my archive playback using SW_Scale. But through 20 live videos on one screen and the swscale and color conversion kills the cpu, you then need gpu support.
someone-noone 10:07 yeah, sws_scale can convert fast only if --enable-gpl
so, i guess to make conversion by myself
jshanab_wcw 10:07 I could have 4 720x480 videos witha a 3ghz dual core max with SWscale and color conversion. maybe taxilians way is faster though
someone-noone 10:07 it should be faster, i looked at sources of sws_scale and they're making math computation
jshanab_wcw 10:07 But their math combines color conversion AND scaling. It gives a smoothing filter that interpolates and I must say the quality of scaled video is noticibly better than even directX's scaling
If you let the browser scale it, it will look like crap :-(
someone-noone 10:07 you may see in ffmpeg -pix_fmts that there is no fast conversation for packed yuv, for example
i mean, no hardware support
so you will anyway use your CPU for yuv 2 packed yuv conversation
but you may use sws_scale only for scaling
jshanab_wcw 10:07 yeah but packing and unpacking is kinda cheap by comparison. You have to copy the pixel data in anyway, so just pack it on the fly
No sws_scale does color conversion at the same time
someone-noone 10:07 you may use it only for scaling
without color conversion
jshanab_wcw 10:07 you may...
someone-noone 10:07 and packing\ unpacking is cheaper then yuv2rgba, but also needs some computation
standart yuv is 4:2:0, packed 4:2:2
12 bpp vs 16bpp, anyway you may do some math to have 16 bytes from 12
jshanab_wcw 10:07 No!. You MUST copy the pixels in. and 420 vs 422 is NOT planer vs packed. (school of hard knoks last week)
someone-noone 10:07 i mean, frames are most of all are planar 420
and you need to draw 422 packed
jshanab_wcw 10:07 The math of the copy changes, but it is so simple as to be very littl than a straight copy
Why do i need to draw 422 packed? is that an apple requirement? I am only dealing with 420 and 422 planer at the moment
someone-noone 10:07 i can't agree or disagree with you. I believe that it is very small
yes, apple supported only 422 packed :)
jshanab_wcw 10:07 ok, and directx only supports 2 of the 27 YUV formats :-) ...directly... we have to "adjust"
someone-noone 10:07 i guess directx supports planar 420 ?
jshanab_wcw 10:07 "The problem with standards...Ther are so many to choose from" like the phrase "Proprietary standards" sheesh
I set the surface to planer and copy in the data, directX handles in the GPU from planer to rgba
someone-noone 10:07 so it supports planar. But which one? 420?
jshanab_wcw 10:07 Or software in main memory if you create the device that way. as a fallback
I am doing 422p (YUY2) and 420P(yv12)
someone-noone 10:07 then it is good
then you may use sws_scale
without any penalties
jshanab_wcw 10:07 But i do agree directx sucks.
someone-noone 10:07 but on mac... it's a sad story :)
jshanab_wcw 10:07 sws_scale does not accelerate in that many situations. :-(
someone-noone 10:07 that's why i'm going to use own pixel format converter
jshanab_wcw 10:07 I was hoping SDL-1.3 would do the "find the best" negotiation for me and abstract it away form me, but is was not to be.
someone-noone 10:07 i was hoping too
but after your words going to use directx\other way)
jshanab_wcw 10:07 Darn, i was hoping you would solve my bug for me ;-)
someone-noone 10:07 you may use yuv2rgba for that card
and write fast conversation function
that will be enought i guees
if not, you may put your fast conversation function on shader
if it present there :) if not, you aren't able doing it faster than "fast_conversatio n"
jshanab_wcw 10:07 If that works out really well then i may go back to using SFML which is working great for my single video player. I planed on trying that with an optional loading shader. Go openGL and be 10x more portable, even across directX enabled cards.
someone-noone 10:07 i'm not sure that openGL will works on every windows with every video car
but everthing of this can be *optional*
jshanab_wcw 10:07 No of course not, but it IS video, i have to draw the line somewhere. "any recent video card worth a darn"
someone-noone 10:07 if i understand right: apple, windows with their opengl\directx doing the same with shader that you can do
jshanab_wcw 10:07 So we have shelfs of little windwos boxes for our embedded application, it has the dual atom processor with the Intel 3150 card. I need to get it working on that in addition to the NVIDA and ATI cards most people have. i think that hits the 90%
someone-noone 10:07 but one difference, that if opengl\directx fails your plugin fails too, but if you will make conversation by yourself you may always choose best avaliable option
i recommended you to go the way i was telling you
jshanab_wcw 10:07 Yup. I have three inits now, fastest fast and slow. on first success it continues.
someone-noone 10:07 you meant not success, but failure, didn't you?
or i misunderstood smth
jshanab_wcw 10:07 BTW opengl can run software only, it was originally designed as a software only solution. So without changing your code, you install mesa
someone-noone 10:07 i don't know how it is on windows yet, but on mac you can use hardware using opengl
jshanab_wcw 10:07 Try fastest DeviceCreate in direct x, if result code is no go, try next DeviceCreate...etc
someone-noone 10:07 then i understood correct
someone-noone 10:07 got os crash
jshanab_wcw 10:07 ouch
welcome back. I had some awful ones after the last power outage. I have a UPS now!
someone-noone 10:07 fortunately, i have notebook :)
jshanab_wcw 10:07 I may of just reproduced the access violation errors I was getting in SDL-1.3 which means I know what they are also not doing. Releaseing resources!
someone-noone 10:07 so did you find the way to fix it?
jshanab_wcw 10:07 It takews me a bit to build it transfer to ftp, go to embedded box download and install then start the remote
jshanab_wcw 11:07 Well. no more crash but just a dumb white square. Even though the pixel data is good and I can see it being copied in. grrr
firing 11:07 Quick question all: To pass a string inside a method can I just use (string myVar)?
Im new to C++ and looking online it seems string is a valid type to use but i seem to get an error
someone-noone 11:07 did you specify namespace?
std::string ?
jshanab_wcw 11:07 const std::string& if you are not modifing it but I will say that you have to watch out for passing string accross dll boundries.
pastebin us the code
firing 11:07 Did not specify namespace before. aargh so used to java and just normal c
well the part thats gives me an error: void MyPluginAPI::connectPlugin(bool image, string data) {
trying std::string now
jshanab_wcw 11:07 namespace in C++ is like package in JAVA (if your java code doesn't use package, then well it is like c++ code written without namespaces) :-)
firing 11:07 What was the thing you said I should watch out for in passing string?
jshanab_wcw 11:07 If you are passing between a dll and the main plugin. windows will let you get away with this until it is larger than some size X then it slices it off. At that point I reccommend using boost shared pointer, the problem is it must be constructed and destructed in the same scope
Unless ref counted which is why shared pointer makes it easy
firing 11:07 Hmm this is mainly for a chrome extension I'm building this plugin for. I don't think my strings will be more than 500 char
jshanab_wcw 11:07 If all your code is in one "translation unit" no dlls, then you are safe.
firing 11:07 Well the chrome ext is not a dll so hopefully im in the clear!
Another quick q: can I use Ldata (where data is the string)? I use L"string here" for other strings
but Ldata doesnt seem valid
someone-noone 11:07 i'm getting this error sometimes: "malloc: incorrect checksum for freed object - object was probably modified after being freed"
i've put symbolic breakpoint into malloc_error_break
and even stopped there, when this error occurs
but in a callstack i see only functions called from main thread(browser)
so i can't understand what is going on wrong in my plugin
jshanab_wcw 11:07 What debugger?
someone-noone 11:07 gdb
jshanab_wcw 11:07 I have not used GDB recently (stuck in VS these days) but you may need to switch thread contexts to then see the other stack frames
someone-noone 11:07 there are 44 other threads :D
jshanab_wcw 11:07 someone-noone. I have reproduced the situation with SDL-1.3 on directX in my own DirectX code in that I get no video under the exact same situations as they crash. because i check the pointer for null and return. Why and what we are forgetting to release i do not know...but I am working on it. Since i have a bug report in for them I'd like to update or retract it if i find out what it is!
someone-noone 11:07 check also for !pointer_name
jshanab_wcw 11:07 someone-noone. I have taken to nameing threads, just for that reason (I have had over 200 when things go horibly wrong) Cna you do that in gdb?
someone-noone 11:07 i guess, no )
pointer can be invalid
but not equal NULL
jshanab_wcw 11:07 Well, then add a class member variable and call it thread name and set it in the ctor :-)
someone-noone 11:07 hm
i'm getting this error in main thread
i don't know how should i find it :)
jshanab_wcw 11:07 Sounds like the pointer was never initialized or was set to null when it is in fact a ref that must always point to an object. Those errors are a bit foriegn to me.
someone-noone 11:07 me too
jshanab_wcw 13:07 someone-noone. Since I found such an analog tothe error I was having in SDL-1.3, I am gonna try it one last time. I will let you know how it goes.
someone-noone 13:07 thanks
jshanab_wcw 13:07 If it works the answer is religous releaseing of objects in the reverse order of allocation. directx is internally reference counded and some of the get functions bump the reference cound and are NOT auto released, you must be explicit. It looks like the SDL is a thin wrapper and also needs the mirrored Destroy calls. I was missing one
someone-noone 13:07 plugin development is very unpredictable :D
i will go for a walk, have a nice evening!
jshanab_wcw 13:07 To make it even more unpridicatble, use Microsoft Products.
Morinign here
oh, i guess afternoon, i lost track of time
someone-noone 13:07 then afternoon :) you haven't developed on mac: 3 graphical subsystems, 2 - event subsystems - noone, even microsoft, can't beat it :)
jshanab_wcw 13:07 Next weekend :-)
someone-noone 13:07 good day!
someone-noone 15:07 good night!
jshanab_wcw 15:07 night
dodo 15:07 can anyone recommend an IDE to use for firebreath project in ubuntu?
jshanab_wcw 15:07 kdevelop
someone-noone 15:07 netbeans\codeblocks
taxilian 15:07 vim
someone-noone 15:07 :pray:
dodo 15:07 and compiler?
someone-noone 15:07 gcc
dodo 15:07 ta
taxilian 15:07 gcc is really the only one you can use
someone-noone 15:07 i've noticed that it's impossible to precalculate YUV 2 RGB conversation
taxilian 15:07 unless someone knows something I don't
jshanab_wcw 15:07 GCC period. It rocks! Seriously you will use vim a lot, but if you are use to things like intelisense then the first 3 are the heavy weights.
taxilian 15:07 someone-noone: what do you mean?
dodo 15:07 thanks everyone
someone-noone 15:07 RGB: for each pixel you have r, g and b value
YUV: for each pixel you have Y value and for 2x2 blocks you have U and V value
so you can't calculate exact value for each pixel
taxilian 15:07 trying to remember how I did it; it is possible to speed things up, at least
jshanab_wcw 15:07 So you end up with a lookup table in which some share the U and V index
taxilian 15:07 that sounds like it might be it
jshanab_wcw 15:07 like a database with a compund key
taxilian 15:07 it's been awhile
someone-noone 15:07 wait
it is possible in YUV 2 RGB
but not from RGB 2 YUV i guess..
but it should be the same for all types
jshanab_wcw 15:07 As long as you are not scaling also. Then there is interpolation involved or it will look poor
someone-noone 15:07 so it seems to be not an easy task
jshanab_wcw 15:07 420 is ok, but 422 really messes up interpolation :-)
someone-noone 15:07 i need 420 to rgba
yeah, it should use some kind of compund key
jshanab_wcw 15:07 then color = color[y*offset+ Umod2*Uoffset + Vmod2]
someone-noone 15:07 why mod 2?
jshanab_wcw 15:07 Well the mod2 is elsewhere, my bad it is U[pixel mad 2] to figure out for each pixle to use the U value that is used for every to Y values,
I have to think this thru. You got 720 x 480 and are going for the pixel at 100,100 you have a buffer of Y,U, and V you need to look up the color for Y(100,100) , U(50,50) and V(50,50) So you get the offset into the Y buffer, the Ubuffer and for 420 use it for the V buffer and then lookup the color in the table
someone-noone 15:07 seems you're right
i just came in to my home and was going to sleep
but then, i started to think how i will do conversation
for precalculation you need to calc all possible combinations of U and V with 4 Y pixels
jshanab_wcw 15:07 Good luck getting to sleep! Let me know when you get to H264 decoding, thats more like counting sheep
someone-noone 16:07 what is a problem in h264?
there shouldn't be
jshanab_wcw 16:07 The relation of Odd/vs even of the x and y coordinates of the Y value may allow you to expand the table to have some pre-interpolated values. I do not know if that makes any difference though
it is "standard" So everyone does it differntly
someone-noone 16:07 i don't understand why interpolation is need
r = f(y,u,v)
g = f2(y,u,v)
b = f3(y,u,v)
so for precalculation i need to have in memory y*u*v matrix
so it sounds easy, if i didn't miss anything
jshanab_wcw 16:07 If the U value is hue 1 for the 4 Y pixels surrounding it and the U value is hue 2 for the second set, Arn't the pixels on the edge having a U value partway between? I think this is an advanced filter
Yeah probably do not need interpolated values, nevermind
Sorry, i am debugging and VS is doing the damndest thing
someone-noone 16:07 btw, how are your sdl ?
but, about inerpolation: i see this word often in swscale
jshanab_wcw 16:07 I have a white screen no video for some reason. I am debugging but when it calls foo(), it goes to bar() even when single stepping. before it could not compile the code until i retyped some by hand, some weird character in the code. A real piece of junk, but with nice tools. LOL
someone-noone 16:07 tried to clean it up?
jshanab_wcw 16:07 Right, when you scale the Y value you have to scale the U and V differently and come up with approximations of what the added pixles would probably be if they were there originally
someone-noone 16:07 so, scaling i will do with sws_scale, but pixels conversation i will do by myself
and when i do it software i will try to put that "magic" matrix to GPU
dodo 16:07 which prep file should i run in ubuntu?
someone-noone 16:07 VRAM i meant
dodo 16:07 ta
someone-noone 16:07 taxilian: have a minute?
hm... i forgot that i have rgba
jshanab_wcw 16:07 are you doing translucency?
someone-noone 16:07 no
but have rgb32
that mean i need to fill 4 rows
or alpha row can be set as some default?
jshanab_wcw 16:07 RGB32 is faster than rgb24 because of the hardware word size
someone-noone 16:07 rgb32 is equal to rgba. Don't think it is one byte per compoment
jshanab_wcw 16:07
someone-noone 16:07 omg
i did the same mistake twice
jshanab_wcw 16:07 But you may find you have to exchange bytes. widows GDI is BGR not RGB
2 worngs dont make a right (but 3 rights make a left)
someone-noone 16:07 i don't believe that one day i was solving integral and differential equations
and yesterday i calced 8*4=24
and today i did the same mistake
when started to think that it is not a word per component in rgb32
what a shame :)
now, seriously
jshanab_wcw 16:07 8*4 is 20
there are 10 kinds of people in the world...
someone-noone 16:07 on mac it is also bgr32
so it is good
jshanab_wcw 16:07 I think the graphics cards have started to win out on the OS differences
someone-noone 16:07 that are understanding binary data and not?
jshanab_wcw 16:07 yup
When i went back to college i use to tell all the girls that asked I was 25 (yeah in hex)
someone-noone 16:07 hehe)
so alpha compoment may always be set to 0?
and i can calculate only r,g andb
jshanab_wcw 16:07 I think 255 is opaque and 0 is 100 % translucent (set it fo 50% to start
yeah no need to calculate Alpha value
someone-noone 16:07 do you think formula from wiki will be good?
jshanab_wcw 16:07 yeah, probably but you will learn as you test and can adjust later. There seems to be a lot af varience in color space conversion. Wrong is wrong, but right is subjective
taxilian 16:07 someone-noone: did you still have a question for me, or are you figuring it out?
someone-noone 16:07 jshanab_wcw: thanks for advide
taxilian: yes
i'm getting a crash sometimes when i'm trying to close tab with plugin window
dodo 16:07 what do i need to run in ubuntu once i have prepmake to compile my plugin?
someone-noone 16:07 here what i see in console:
taxilian 16:07 dodo: have you looked at the building in linux page?
someone-noone 16:07 *malloc* object was probably modified after being freed
dodo 16:07 nope. looking at it now.
someone-noone 16:07 i've put the symbolical breakpoint
to the malloc_error_break
and in a call stack i see more than 30 threads
but error seems to appear in main thread
so if i understand right, it is a browser's crash
how can i debug such error?
taxilian 16:07 it may be a plugin crash
and I don't know; that sounds like a tricky one
that is way more threads than should be around after your plugin is shut down, though
so I'd start out by making sure that your threads are getting shut down properly
jshanab_wcw 16:07 I had that a lot in the beginning. Threads I did not wait for, api calls calling a dead plugin, etc
someone-noone 16:07 one question:
if i close tab, will windowDeAttached be called
taxilian 16:07 yes
but the best place to handle closing of threads is probably shutdown() in your plugin class
someone-noone 16:07 i create some threads on window attach and destroy them on window deattach
taxilian 16:07 unless the threads are specifically related to drawing, I guess
makes sense
yeah, just realized that was probably what you were doing =]
someone-noone 16:07 )
so may it be a problem>
or it is calling 100% everytime i close a tab?
taxilian 16:07 it will always get called
when you close a plugin instance, which happens when you close a tab
someone-noone 16:07 then problem is not there
may it be due to memory leaks?
taxilian 16:07 it could be due to lots of things
but I would guess that it's due to things not getting shut down when they should
someone-noone 16:07 hopeful
taxilian 16:07 that's just the most common issue
attach the debugger, see how many threads are running before you start your plugin
then start your plugin
then close your plugin and see how many are running when it crashes
then figure out which of those may belong to your plugin
then send all your credit card information to me
oh, wait
someone-noone 16:07 :O
taxilian 16:07 no, that last one was for my nigerian scam… different set of instructions
sorry about that
someone-noone 16:07 <3 you
i will try this
taxilian 16:07 good luck
I have a highschool 10 year reunion to attend this evening and my youngest son just started demanding food — which is tricky since my wife is not currently home
I need to go distract him and probably won't be back online 'til Monday
good luck!
someone-noone 16:07 thanks!
have a good days!
taxilian 16:07 hehe. you too
someone-noone 16:07 Is it saturday or sunday now in USA?
taxilian 16:07 sat
someone-noone 16:07 asked, because for me monday is tomorrow :)
taxilian 16:07 =]
jshanab_wcw 16:07 someone-noone. Aussie?
someone-noone 16:07 ich spreche nicht Deutsch )
or what did you mean?
Aussie is word that i don't understand
"Aus sie" ?
jshanab_wcw 17:07 You are in germany? Aussie is Austrailia
someone-noone 17:07 no, i'm from Ukraine