Changeset 186 for trunk


Ignore:
Timestamp:
Jun 28, 2013, 6:19:16 AM (11 years ago)
Author:
roman
Message:

Additional IWMStreamConfig related data

Location:
trunk/Utilities/WindowsMediaCodecList
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Utilities/WindowsMediaCodecList/AboutDialog.h

    r66 r186  
    11////////////////////////////////////////////////////////////
    2 // Copyright (C) Roman Ryltsov, 2009-2012
     2// Copyright (C) Roman Ryltsov, 2008-2013
    33// Created by Roman Ryltsov roman@alax.info
    4 //
    5 // $Id$
    64
    75#pragma once
     
    114112                #pragma endregion
    115113                #pragma region Caption
    116                 {
    117                         #if _TRACE || defined(_WIN64)
    118                         CString sCaption;
    119                         _W(GetWindowText(sCaption));
    120                         sCaption.Append(_T(" // "));
    121                         #if _DEVELOPMENT
    122                         sCaption.Append(_T("Dev "));
    123                         #endif // _DEVELOPMENT
    124                         sCaption.Append(_VersionInfoHelper::GetVersionString(_VersionInfoHelper::GetFileVersion(_VersionInfoHelper::GetModulePath())));
    125                         #if defined(_WIN64)
    126                         sCaption.Append(_T(" (x64)"));
    127                         #endif // defined(_WIN64)
    128                         _W(SetWindowText(sCaption));
    129                         #endif // _TRACE || defined(_WIN64)
    130                 }
     114                #if _TRACE || defined(_WIN64)
     115                        {
     116                                CString sCaption;
     117                                _W(GetWindowText(sCaption));
     118                                sCaption.Append(_T(" // "));
     119                                #if _DEVELOPMENT
     120                                        sCaption.Append(_T("Dev "));
     121                                #endif // _DEVELOPMENT
     122                                sCaption.Append(_VersionInfoHelper::GetVersionString(_VersionInfoHelper::GetFileVersion(_VersionInfoHelper::GetModulePath())));
     123                                #if defined(_WIN64)
     124                                        sCaption.Append(_T(" (x64)"));
     125                                #endif // defined(_WIN64)
     126                                _W(SetWindowText(sCaption));
     127                        }
     128                #endif // _TRACE || defined(_WIN64)
    131129                #pragma endregion
    132130                #pragma region Window Position and Focus
  • trunk/Utilities/WindowsMediaCodecList/MainDialog.h

    r67 r186  
    11////////////////////////////////////////////////////////////
    2 // Copyright (C) Roman Ryltsov, 2009-2012
     2// Copyright (C) Roman Ryltsov, 2008-2013
    33// Created by Roman Ryltsov roman@alax.info
    4 //
    5 // $Id$
    64
    75#pragma once
     
    476474                        {
    477475                                if(!m_pCodecFormatData->m_sDescription.IsEmpty())
     476                                {
    478477                                        sText.AppendFormat(_T("Description: %ls\r\n"), m_pCodecFormatData->m_sDescription);
     478                                        sText.Append(_T("\r\n"));
     479                                }
     480                                #pragma region Interfaces
     481                                if(m_pCodecFormatData->m_pWmStreamConfig)
     482                                {
     483                                        sText += AtlFormatString(_T("Interfaces:") _T("\r\n"));
     484                                        static const struct
     485                                        {
     486                                                const IID* pIdentifier;
     487                                                LPCSTR pszName;
     488                                        } g_pMap[] =
     489                                        {
     490                                                #define A(x) { &__uuidof(x), #x },
     491                                                A(IWMMediaProps)
     492                                                A(IWMStreamConfig)
     493                                                A(IWMStreamConfig2)
     494                                                A(IWMStreamConfig3)
     495                                                A(IWMVideoMediaProps)
     496                                                #undef A
     497                                        };
     498                                        for(SIZE_T nIndex = 0; nIndex < DIM(g_pMap); nIndex++)
     499                                        {
     500                                                CComPtr<IUnknown> pUnknown;
     501                                                m_pCodecFormatData->m_pWmStreamConfig->QueryInterface(*g_pMap[nIndex].pIdentifier, (VOID**) &pUnknown);
     502                                                if(pUnknown)
     503                                                        sText += AtlFormatString(_T("  ") _T("%hs") _T("\r\n"), g_pMap[nIndex].pszName);
     504                                        }
     505                                        sText.Append(_T("\r\n"));
     506                                }
     507                                #pragma endregion
     508                                #pragma region Media Type
    479509                                if(m_pCodecFormatData->m_pMediaType)
    480510                                {
    481                                         sText.Append(_T("\r\n"));
    482511                                        sText.Append(_T("AM_MEDIA_TYPE:\r\n"));
    483512                                        const CMediaType& pMediaType = reinterpret_cast<const CMediaType&>(m_pCodecFormatData->m_pMediaType);
     
    514543                                        #pragma endregion
    515544                                        sText.AppendFormat(_T("  cbFormat: %s\r\n"), _StringHelper::FormatNumber((LONG) pMediaType->cbFormat));
     545                                        #pragma region FORMAT_VideoInfo
    516546                                        if(pMediaType->formattype == FORMAT_VideoInfo)
    517547                                        {
     
    538568                                                //biClrUsed;
    539569                                                //biClrImportant;
     570                                                sText.Append(_T("\r\n"));
     571
    540572                                        } else
     573                                        #pragma endregion
     574                                        #pragma region FORMAT_VideoInfo2
    541575                                        if(pMediaType->formattype == FORMAT_VideoInfo2)
    542576                                        {
     
    572606                                                //biClrImportant;
    573607                                        } else
     608                                        #pragma endregion
     609                                        #pragma region FORMAT_WaveFormatEx
    574610                                        if(pMediaType->formattype == FORMAT_WaveFormatEx)
    575611                                        {
     
    596632                                                                sText.AppendFormat(_T("  %s\r\n"), StringFromData((const BYTE*) (pWaveFormatEx + 1), pWaveFormatEx->cbSize));
    597633                                        }
    598                                 }
     634                                        #pragma endregion
     635                                }
     636                                #pragma endregion
     637                                #pragma region IWMMediaProps
     638                                const CComQIPtr<IWMMediaProps> pWmMediaProps = m_pCodecFormatData->m_pWmStreamConfig;
     639                                if(pWmMediaProps)
     640                                        _ATLTRY
     641                                        {
     642                                                GUID Type = GUID_NULL;
     643                                                __C(pWmMediaProps->GetType(&Type));
     644                                                sText.Append(_T("IWMMediaProps:\r\n"));
     645                                                sText.AppendFormat(_T("  ") _T("Type: %ls") _T("\r\n"), _FilterGraphHelper::FormatMajorType(Type));
     646                                                sText.Append(_T("\r\n"));
     647                                        }
     648                                        _ATLCATCHALL()
     649                                        {
     650                                                _Z_EXCEPTION();
     651                                        }
     652                                #pragma endregion
     653                                #pragma region IWMStreamConfig
     654                                const CComQIPtr<IWMStreamConfig> pWmStreamConfig = m_pCodecFormatData->m_pWmStreamConfig;
     655                                if(pWmStreamConfig)
     656                                        _ATLTRY
     657                                        {
     658                                                GUID StreamType = GUID_NULL;
     659                                                __C(pWmStreamConfig->GetStreamType(&StreamType));
     660                                                WORD nStreamNumber = 0;
     661                                                __C(pWmStreamConfig->GetStreamNumber(&nStreamNumber));
     662                                                WORD nStreamNameLength = 0;
     663                                                pWmStreamConfig->GetStreamName(NULL, &nStreamNameLength);
     664                                                CTempBufferT<WCHAR> pszStreamName(nStreamNameLength + 1);
     665                                                __C(pWmStreamConfig->GetStreamName(pszStreamName, &nStreamNameLength));
     666                                                WORD nConnectionNameLength = 0;
     667                                                pWmStreamConfig->GetConnectionName(NULL, &nConnectionNameLength);
     668                                                CTempBufferT<WCHAR> pszConnectionName(nConnectionNameLength + 1);
     669                                                __C(pWmStreamConfig->GetConnectionName(pszConnectionName, &nConnectionNameLength));
     670                                                DWORD nBitrate = 0;
     671                                                __C(pWmStreamConfig->GetBitrate(&nBitrate));
     672                                                DWORD nBufferWindow = 0;
     673                                                __C(pWmStreamConfig->GetBufferWindow(&nBufferWindow));
     674                                                sText.Append(_T("IWMStreamConfig:\r\n"));
     675                                                sText.AppendFormat(_T("  ") _T("StreamType: %ls") _T("\r\n"), _FilterGraphHelper::FormatMajorType(StreamType));
     676                                                sText.AppendFormat(_T("  ") _T("StreamNumber: %d") _T("\r\n"), nStreamNumber);
     677                                                if(wcslen(pszStreamName))
     678                                                        sText.AppendFormat(_T("  ") _T("StreamName: %ls") _T("\r\n"), (LPCWSTR) pszStreamName);
     679                                                if(wcslen(pszConnectionName))
     680                                                        sText.AppendFormat(_T("  ") _T("ConnectionName: %ls") _T("\r\n"), (LPCWSTR) pszConnectionName);
     681                                                sText.AppendFormat(_T("  ") _T("Bitrate: %d") _T("\r\n"), nBitrate);
     682                                                sText.AppendFormat(_T("  ") _T("BufferWindow: %d") _T("\r\n"), nBufferWindow);
     683                                                sText.Append(_T("\r\n"));
     684                                        }
     685                                        _ATLCATCHALL()
     686                                        {
     687                                                _Z_EXCEPTION();
     688                                        }
     689                                #pragma endregion
     690                                #pragma region IWMStreamConfig2
     691                                const CComQIPtr<IWMStreamConfig2> pWmStreamConfig2 = m_pCodecFormatData->m_pWmStreamConfig;
     692                                if(pWmStreamConfig2)
     693                                        _ATLTRY
     694                                        {
     695                                                WMT_TRANSPORT_TYPE TransportType;
     696                                                __C(pWmStreamConfig2->GetTransportType(&TransportType));
     697                                                WORD nDataUnitExtensionCount = 0;
     698                                                pWmStreamConfig2->GetDataUnitExtensionCount(&nDataUnitExtensionCount);
     699                                                for(WORD nDataUnitExtensionIndex = 0; nDataUnitExtensionIndex < nDataUnitExtensionCount; nDataUnitExtensionIndex++)
     700                                                {
     701                                                        GUID Identifier = GUID_NULL;
     702                                                        WORD nSize = 0;
     703                                                        DWORD nInformationSize = 0;
     704                                                        __C(pWmStreamConfig2->GetDataUnitExtension(nDataUnitExtensionIndex, &Identifier, &nSize, NULL, &nInformationSize));
     705                                                }
     706                                                sText.Append(_T("IWMStreamConfig2:\r\n"));
     707                                                sText.AppendFormat(_T("  ") _T("TransportType: %d") _T("\r\n"), TransportType);
     708                                                if(nDataUnitExtensionCount)
     709                                                        sText.AppendFormat(_T("  ") _T("DataUnitExtensionCount: %d") _T("\r\n"), nDataUnitExtensionCount);
     710                                                sText.Append(_T("\r\n"));
     711                                        }
     712                                        _ATLCATCHALL()
     713                                        {
     714                                                _Z_EXCEPTION();
     715                                        }
     716                                #pragma endregion
     717                                #pragma region IWMStreamConfig3
     718                                const CComQIPtr<IWMStreamConfig3> pWmStreamConfig3 = m_pCodecFormatData->m_pWmStreamConfig;
     719                                if(pWmStreamConfig3)
     720                                        _ATLTRY
     721                                        {
     722                                                WORD nLanguageStringLength = 0;
     723                                                pWmStreamConfig3->GetLanguage(NULL, &nLanguageStringLength);
     724                                                CTempBufferT<WCHAR> pszLanguageString(nLanguageStringLength + 1);
     725                                                __C(pWmStreamConfig3->GetLanguage(pszLanguageString, &nLanguageStringLength));
     726                                                if(wcslen(pszLanguageString))
     727                                                {
     728                                                        sText.Append(_T("IWMStreamConfig3:\r\n"));
     729                                                        if(wcslen(pszLanguageString))
     730                                                                sText.AppendFormat(_T("  ") _T("Language: %ls") _T("\r\n"), (LPCWSTR) pszLanguageString);
     731                                                        sText.Append(_T("\r\n"));
     732                                                }
     733                                        }
     734                                        _ATLCATCHALL()
     735                                        {
     736                                                _Z_EXCEPTION();
     737                                        }
     738                                #pragma endregion
     739                                #pragma region IWMVideoMediaProps
     740                                const CComQIPtr<IWMVideoMediaProps> pWmVideoMediaProps = m_pCodecFormatData->m_pWmStreamConfig;
     741                                if(pWmVideoMediaProps)
     742                                        _ATLTRY
     743                                        {
     744                                                LONGLONG nMaximalKeyFrameIntervalTime = 0;
     745                                                __C(pWmVideoMediaProps->GetMaxKeyFrameSpacing(&nMaximalKeyFrameIntervalTime));
     746                                                DWORD nQuality = 0;
     747                                                __C(pWmVideoMediaProps->GetQuality(&nQuality));
     748                                                sText.Append(_T("IWMVideoMediaProps:\r\n"));
     749                                                sText.AppendFormat(_T("  ") _T("MaxKeyFrameSpacing: %s") _T("\r\n"), _FilterGraphHelper::FormatReferenceTime(nMaximalKeyFrameIntervalTime));
     750                                                sText.AppendFormat(_T("  ") _T("Quality: %d") _T("\r\n"), nQuality);
     751                                                sText.Append(_T("\r\n"));
     752                                        }
     753                                        _ATLCATCHALL()
     754                                        {
     755                                                _Z_EXCEPTION();
     756                                        }
     757                                #pragma endregion
    599758                        }
    600759                        sText.Trim(_T("\t\n\r ."));
     
    10261185        LRESULT OnCopyButtonClicked(UINT, INT, HWND)
    10271186        {
    1028                 CStringW sText(GetSubmissionText());
    1029                 __E(OpenClipboard());
    1030                 _ATLTRY
    1031                 {
    1032                         __E(EmptyClipboard());
    1033                         CGlobalMemoryHandle TextHandle;
    1034                         TextHandle.Alloc((sText.GetLength() + 1) * sizeof (WCHAR), GMEM_MOVEABLE | GMEM_SHARE);
    1035                         wcscpy_s(CGlobalMemoryHandle::CLockT<WCHAR>(TextHandle), sText.GetLength() + 1, sText);
    1036                         __E(SetClipboardData(CF_UNICODETEXT, TextHandle));
    1037                         TextHandle.Detach();
    1038                         MessageBeep(MB_OK);
    1039                 }
    1040                 _ATLCATCHALL()
    1041                 {
    1042                         _W(CloseClipboard());
    1043                         _ATLRETHROW;
    1044                 }
    1045                 _W(CloseClipboard());
     1187                SetClipboardText(m_hWnd, GetSubmissionText());
     1188                MessageBeep(MB_OK);
    10461189                return 0;
    10471190        }
     
    10491192        {
    10501193                CWaitCursor WaitCursor;
     1194                const CString sFileDescription = _VersionInfoHelper::GetString(_VersionInfoHelper::GetModulePath(), _T("FileDescription"));
    10511195                CWinHttpPostData PostData;
    1052                 PostData.AddValue(_T("subj"), _T("Alax.Info Windows Media Codec List"));
     1196                PostData.AddValue(_T("subj"), sFileDescription);
    10531197                CStringA sTextA = Utf8StringFromString(GetSubmissionText());
    10541198                PostData.AddValue(_T("body"), _Base64Helper::Encode<CString>((const BYTE*) (LPCSTR) sTextA, sTextA.GetLength(), _Base64Helper::FLAG_NOPAD | _Base64Helper::FLAG_NOCRLF));
     
    10651209                DWORD nStatusCode = 0;
    10661210                __E(Request.QueryNumberHeader(WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, nStatusCode));
    1067                 __D(nStatusCode == HTTP_STATUS_OK, MAKE_HRESULT(SEVERITY_ERROR, FACILITY_HTTP, nStatusCode));
     1211                __D(nStatusCode / 100 == HTTP_STATUS_OK / 100, MAKE_HRESULT(SEVERITY_ERROR, FACILITY_HTTP, nStatusCode));
    10681212                AtlMessageBoxEx(m_hWnd, _T("Submission complete, thank you!"), IDS_INFORMATION, MB_ICONINFORMATION | MB_OK);
    10691213                return 0;
  • trunk/Utilities/WindowsMediaCodecList/WindowsMediaCodecList.cpp

    r66 r186  
    11////////////////////////////////////////////////////////////
    2 // Copyright (C) Roman Ryltsov, 2009-2012
     2// Copyright (C) Roman Ryltsov, 2008-2013
    33// Created by Roman Ryltsov roman@alax.info
    4 //
    5 // $Id$
    64
    75#include "stdafx.h"
     
    2220        CModule() throw()
    2321        {
    24 #if defined(_DEBUG)
    25                 AtlTraceLoadSettings(NULL);
    26 #endif // defined(_DEBUG)
     22                AtlTraceSetDefaultSettings();
    2723        }
    2824        HRESULT PreMessageLoop(INT nShowCommand) throw()
  • trunk/Utilities/WindowsMediaCodecList/WindowsMediaCodecList.rc

    r67 r186  
    9090    LTEXT           "Email:",IDC_ABOUT_EMAILTITLE,60,72,20,8
    9191    LTEXT           "<A HREF=""mailto:support@alax.info"">support@alax.info</A>",IDC_ABOUT_EMAIL,108,72,162,8,NOT WS_GROUP | WS_TABSTOP
    92     LTEXT           "Copyright © Alax.Info, Roman Ryltsov, 2009-2012",IDC_ABOUT_COPYRIGHT,60,84,210,8,SS_NOPREFIX
     92    LTEXT           "Copyright © Alax.Info, Roman Ryltsov, 2008-2013",IDC_ABOUT_COPYRIGHT,60,84,210,8,SS_NOPREFIX
    9393    DEFPUSHBUTTON   "OK",1,220,102,50,14
    9494    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,6,122,267,1
     
    122122
    123123VS_VERSION_INFO VERSIONINFO
    124  FILEVERSION  1, 0, 0, 205
     124 FILEVERSION  1, 0, 0, 223
    125125 PRODUCTVERSION 1,0,0,1
    126126 FILEFLAGSMASK 0x3fL
     
    141141            VALUE "Created By", "Roman Ryltsov <roman@alax.info>"
    142142            VALUE "FileDescription", "Windows Media Codec List Utility"
    143             VALUE "FileVersion",  "1, 0, 0, 205\0"
     143            VALUE "FileVersion",  "1, 0, 0, 223\0"
    144144            VALUE "InternalName", "WindowsMediaCodecList"
    145             VALUE "LegalCopyright", "Copyright © Alax.Info, Roman Ryltsov, 2009-2012"
     145            VALUE "LegalCopyright", "Copyright © Alax.Info, Roman Ryltsov, 2008-2013"
    146146            VALUE "OriginalFilename", "WindowsMediaCodecList.exe"
    147147            VALUE "ProductName", "Windows Media Codec List Utility"
  • trunk/Utilities/WindowsMediaCodecList/WindowsMediaCodecList.sln

    r66 r186  
    11
    22Microsoft Visual Studio Solution File, Format Version 11.00
    3 # Visual Studio 2010
     3# Visual Studio 2012
    44Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WindowsMediaCodecList", "WindowsMediaCodecList.vcxproj", "{1C8C592C-968B-4CDA-A548-952ECA5FE2A8}"
    55EndProject
  • trunk/Utilities/WindowsMediaCodecList/_Bin/Win32

    • Property svn:global-ignores set to
      Debug
  • trunk/Utilities/WindowsMediaCodecList/_Bin/Win32/Release

    • Property svn:global-ignores set to
      WindowsMediaCodecList
  • trunk/Utilities/WindowsMediaCodecList/_Bin/x64/Release

    • Property svn:global-ignores set to
      WindowsMediaCodecList
  • trunk/Utilities/WindowsMediaCodecList/stdafx.cpp

    r66 r186  
    11////////////////////////////////////////////////////////////
    2 // Copyright (C) Roman Ryltsov, 2008-2012
     2// Copyright (C) Roman Ryltsov, 2008-2013
    33// Created by Roman Ryltsov roman@alax.info
    4 //
    5 // $Id$
    64
    75#include "stdafx.h"
  • trunk/Utilities/WindowsMediaCodecList/stdafx.h

    r66 r186  
    11////////////////////////////////////////////////////////////
    2 // Copyright (C) Roman Ryltsov, 2008-2012
     2// Copyright (C) Roman Ryltsov, 2008-2013
    33// Created by Roman Ryltsov roman@alax.info
    4 //
    5 // $Id$
    64
    75#pragma once
     
    7169// Alax.Info ATL/WTL
    7270
    73 #define REGISTRY_PRODUCTROOT    _T("SOFTWARE\\Alax.Info\\Utilities")
     71#define REGISTRY_PRODUCTROOT    _T("SOFTWARE\\Alax.Info\\Utility") _T("\\") _T("WindowsMediaCodecList")
    7472#define REGISTRY_FILEROOT               REGISTRY_PRODUCTROOT
    7573#define REGISTRY_ROOT                   REGISTRY_FILEROOT
Note: See TracChangeset for help on using the changeset viewer.