473,388 Members | 1,346 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Variant to String. VideoCodec - Friendly name in DirectShow

Hi all!
I'm trying to write a console application which allows me to write out
all installed video-codecs.

I tried this one:
http://windowssdk.msdn.microsoft.com.../ms787871.aspx
The code is at the end of this post.

My question is how do i get the friendly name (human readable) to the
console. VarName only delivers some codes.

following headers are used:
#include <iostream>
#include <tchar.h>
#include <dshow.h>
#include <cstring>

using namespace std;

#pragma comment(lib,"strmiids.lib")

-------------------------------------
THNX 4 any advice. MM

-------------------------------------

This is the code:
// Create the System Device Enumerator.
HRESULT hr;
ICreateDevEnum *pSysDevEnum = NULL;
hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER,
IID_ICreateDevEnum, (void **)&pSysDevEnum);
if (FAILED(hr))
{
return hr;
}

// Obtain a class enumerator for the video compressor category.
IEnumMoniker *pEnumCat = NULL;
hr = pSysDevEnum->CreateClassEnumerator(CLSID_VideoCompressorCatego ry,
&pEnumCat, 0);

if (hr == S_OK)
{
// Enumerate the monikers.
IMoniker *pMoniker = NULL;
ULONG cFetched;
while(pEnumCat->Next(1, &pMoniker, &cFetched) == S_OK)
{
IPropertyBag *pPropBag;
hr = pMoniker->BindToStorage(0, 0, IID_IPropertyBag,
(void **)&pPropBag);
if (SUCCEEDED(hr))
{
// To retrieve the filter's friendly name, do the following:
VARIANT varName;
VariantInit(&varName);
hr = pPropBag->Read(L"FriendlyName", &varName, 0);
if (SUCCEEDED(hr))
{
// Display the name in your UI somehow.
}
VariantClear(&varName);

// To create an instance of the filter, do the following:
IBaseFilter *pFilter;
hr = pMoniker->BindToObject(NULL, NULL, IID_IBaseFilter,
(void**)&pFilter);
// Now add the filter to the graph.
//Remember to release pFilter later.
pPropBag->Release();
}
pMoniker->Release();
}
pEnumCat->Release();
}
pSysDevEnum->Release();
Sep 17 '06 #1
0 2190

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: romi | last post by:
Hi I have a problem, I want to convert program in Visual Basic 6 to VC++6. Program in VB works OK., but in VC++ I don't know how to convert 'VARIANT' to 'Cstring'. How to convert 'VARIANT ww' to...
0
by: Nick Z. | last post by:
I need to use DirectShow and it is just a pain in the butt with C#. (since the managed version of dx doesnt have directshow) I'm thinking of different ways of getting DirectShow functionality. I...
16
by: Jon Davis | last post by:
Hi guys! Just wanted to let you all know that I created a Variant structure, inspired by the old VB6 days. // Here is an example of use: // start with a string of "1" Variant da = new...
0
by: Lonewolf | last post by:
Hi, I'm not sure if this has been asked before so please pardon me if this is a repeated question. Basically I have some performance critical directshow codes which is implemented in native,...
7
by: Dave | last post by:
Hi, can I use directshow in c#??? dose Microsoft still support direct show sdk or there is a new technology today??? what is the best way to draw on playing video and how can I do that??? ...
1
by: michael mazanek | last post by:
Hi all, i have a VARIANT variable which contains a "friendly name" of a video-codec (direct show). Does anyone know how to retrieve the friendly name as a string to display it on the console? ...
11
by: MLH | last post by:
The following procedures found at http://ffdba.com/downloads/Send_Mail_With_Outlook_Express.htm are meant to work together in harmony to effect eMail sends via OE. The last procedure (FN SplitB)...
4
by: ink | last post by:
Hi All, I am trying to build an image capture user control using DirectShow to be used in an existing C# application. It needs to have a view finder/ preview window and be able to take...
4
by: Anil Gupte | last post by:
How does one go about writing a Directshow Source Filter? Learning resources and a sample application would be great. TIA, -- Anil Gupte www.keeninc.net www.icinema.com
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.