Now i want to control this from an INI file,i want to check from whether #define _WRITE_MPEG_ (1) is commented or uncommented or not and take action accordingly...
Well, let me tell you that, if you want user-control, you should compile your program with both probabilities, so, DO NOT use #define, use IF/ELSE.
Like, make a bool global, and while initializing your program check if you find the requested line in your ini file. If you find it, set your global to true.
Then, at that point into your code, have a simple if, like:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include <...> // After all your inclusion files
bool g_WriteMPEGBool = 0;
// ...
int main() // Entrypoint
{
FILE * Settings = fopen("settings.ini","r");
// Look for the requested option to be set here
if(OptionIsSet)
g_WriteMPEGBool = 1;
// ...
if(g_WriteMPEGBool)
{
InitBufferHandling();
StartRTPProcess();
}