|
Is this method is the only way to initialize the AVCodecContext structure for decoder ?
If I am trying to decode a real time data stream, is there any other method to initialize that??
|
|
|
|
|
I have no idea how to decode a real time data stream, but here's how you get the AVCodecContext for a normal video file from the hard disk.
int err, ret;
AVFormatContext* ic;
err = av_open_input_file(&ic, InputFile, NULL, 0, NULL);
ret = av_find_stream_info(ic);
for(int i=0;i<(int)ic->nb_streams;i++)
{
AVCodecContext *enc = ic->streams[i]->codec;
if (enc->codec_type == CODEC_TYPE_VIDEO)
{
}
}
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Thanks for your reply, it shows me some useful information, I need more trying on this, but I think maybe I need some more example for this .
Can you show me some demo projects ? Maybe that will be more helpful for me, cause I am just a beginner.
Thanks a lot for all your help.
|
|
|
|
|
Hi,
I have no demo projects, but may be you should ask your questions in the official mailing list at https://lists.mplayerhq.hu/mailman/listinfo/libav-user/[^], you might get more help there. For demos, you can also see output_example.c and ffmpeg.c from the SVN sources.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
|
Which one is your question? You asked or implied about 10.
If you're really new to C++, then you really need to get some more simple programming under your belt before trying to do all of that.
Break it into individual steps, and solve those steps.
> im trying to create a simple program that verifies username and password
Well, you'll want to make a modal dialog (CDialog::DoModal) with a couple of edit boxes - one of which can have the ES_PASSWORD style. Then when the user presses OK, validate their entry somehow. If your database has a user name / login system, let the database do the validation.
And so on.
Iain.
ps, Please also use capitals and punctuation - it makes your message a LOT easier to read, and we're not a mobile phone.
|
|
|
|
|
I am trying to send a file to the server but the code is giving the following error:
Error on InternetWriteFile 12031
Please help me with this problem
Thanks In Advance
modified on Wednesday, October 22, 2008 2:10 AM
|
|
|
|
|
Hi All
I have a text file "New.txt".which have some data like this
ab
ac
ad
ab
ad
ac
Now i want to remove duplicate string(ab,ac and ad) from file.Can any one give me tips.
Plz help me
|
|
|
|
|
Use linked lists, either from the STL or of your own making.
Open File, read each line into a new list item.
Go through the list, remove any list items that match the current item.
Save the list items one-by-one back into a new file.
Or
Open file, read file line by line - doing nothing other than counting the number of lines.
Create an array with this many pointers to a string
Reset file pointer
For each line in file:
read line,
determine length,
allocate mem and store pointer in lineArray[currentLine],
copy string to this memory.
For each item in the lineArray
do a strcmp on all items that follow
if the strings match, free the memory of the matching line, and set it's pointer to NULL
For each item in the line Array
if the pointer isn't NULL, it contains a unique string.
If the pointer is NULL, the string wasn't unique and has been removed.
either print or save to file all of the valid strings remaining in the array
For each item in the array
free the used memory (free won't fail on a NULL pointer)
|
|
|
|
|
You can use a std::set for that. Read each line and insert it into your set. If the value is already present in the set, it won't be added a second time.
|
|
|
|
|
That sounds good, but could you extract the entries in the order [*] they were put in? He didn't say whether he cares or not, but I would - minimum changes needed to meet the spec, etc.
Iain.
[*] Genuine question. Not an expert on the std::collections.
|
|
|
|
|
No I don't think so, the set sort the entries. You're right, I didn't think about this, I only thought that he wanted to get rid of the duplicates.
|
|
|
|
|
Cedric Moonen wrote: the set sort the entries.
If I'm not mistaking, if you want it unsorted you should use hash_set, which is located in the stdext namespace
std::map and std::set are sorted
stdext::hasp_map and stdext::hash_set are the unsorted counterparts.
Learn from the mistakes of others, you may not live long enough to make them all yourself.
|
|
|
|
|
Hi,
In my applicationim using ine structure and im storing the values of variables each second.
But the size of structure is very high,the filesize is getting increased each second.
My strucutre is
struct ReplayTags //CD07
{
float SPV [900];
float CSV1 [900];
float CVOUT [900];
float CNTP [900];
float CNTI [900];
float CNTD [900];
....
....
char AMCAS [100];
}
I have to write the value of all variables like SPV,CSV1..in to file each second.
But definetly i can say tht im not using whole 900 SPV values etc.,..sometimes it vary from 100 to 200 like tht only.Its dynamic...depends upon my applcaiton it may vary every time..
But i know how many variables are used in tht application.i can get tht by using one variable of count of SPV.
My question how i declare the variable size as dynamic.
I dnt know how to do it.
WriteFile( htReplayFile, temp,(DWORD)sizeof(struct ReplayTags), (LPDWORD)&ReturnVal, (LPOVERLAPPED)NULL );
THis is code used to write in files,Here im using size of Struct.
Pls help me..
Anu
|
|
|
|
|
You should be able to serialize that structure much more efficiently.
Even writing a count WORD follwed by the floats for each array would
be a huge improvement
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi friends,
I have encountered a problem that I would like to ask you.
I have a Main-Dialog and a child dialog. The child dialog is
hidden and I would like to find it at run time. I use several
APIs such as FindWindow but it is not usefull to me (Since my
child dialog has no caption) and also, EnumWindows and EnumChildWindows,
but apparently these APIs can not find child dialogs.
I put my code here to clarify my solution. Thanks very much in advance.
in the code :
EnumChildWindows(m_hWnd, EnumChildProc, NULL);
/************************************************************************/
BOOL MyDlg::EnumChildProc(HWND hwnd, LPARAM lParam)
{
// Access to the ECDialog members through pThis.
CCMDDlg* pThis = (CCMDDlg*)lParam;
//GetDlgCtrlID()
if ( IDD_CHILD_DLG == FromHandle(hwnd)->GetDlgCtrlID() )
{
// Find Child Dialog
Beep(1000, 500);
return FALSE;
}
return TRUE;
}
/************************************************************************/
BOOL MyDlg::EnumWindowsProc(HWND hwnd, LPARAM lParam)
{
int i = CWnd::FromHandle(hwnd)->GetDlgCtrlID();
if ( IDC_CHILD_DLG == FromHandle(hwnd)->GetDlgCtrlID() )
{
Beep(1000, 2000);
return FALSE;
}
return TRUE;
}
/************************************************************************/
|
|
|
|
|
EnumChildWindows, will enumare only the windows which is creare with WS_CHILD style. I think the only possiblity method for you to use is EnumThreadWindows .
Mohammad Khodaea wrote: if ( IDC_CHILD_DLG == FromHandle(hwnd)->GetDlgCtrlID() )
This technique wont work. Because the ctrl id of dialogs is always 0. The IDC_CHILD_DLG is only used to identify the dialog in the resource.
|
|
|
|
|
Hi all,
Unhandled exception at 0x762c42eb in Test.exe: Microsoft C++ exception: CDBException at memory location 0x001236fc..
occur when i use Open statement for data base.
I m using CRecordset derived classes for database.
When i m using Open(); than this error occurs.
please help me for this.
thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
There should be specific info in the exception object. CDBException has a return code
and two error strings - what's in there?
It's a really good idea to handle the documented exceptions
thrown by the MFC database classes, unless you prefer your apps
to just terminate abnormally, of course
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
It returns -1.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
"_$h@nky_" wrote: It returns -1
What does?
What kind of database are you connecting to?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I m using a Access database with ODBC connesction.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
And -1 is all that's in the thrown exception object? No strings?
I know SQL server returns pretty useful error strings that are placed
in the CDBExceptions....not sure about Access.
You can always step into the Open() call and see where it's failing.
There's lots of potential reasons...
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Now its resolveed,
Thanks sir
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Hello,
Pardon me, its a pure question of C/C++ not specific to Visual C++. Can anybody explain what is the purpose of following code:
void Function1(int a, int b)
{
void Function2(int c, int d, int e); // in some header file
void Function3(int c, int d, int e); // in some header file
int i, k, l;
//rest of the code in which Function2 and Function3 are being used!
}
I have no idea why "Function2" & "Function3" prototypes are defined in the function named "Function1", and is it possible? If yes whats the logic behind it?
Any help is highly appreciated.
Regards,
Adeel
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|