Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8948461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:59:47+00:00 2026-06-15T12:59:47+00:00

I am trying to get my MediaStreamSource to work on Windows Phone 7.1. For

  • 0

I am trying to get my MediaStreamSource to work on Windows Phone 7.1.
For smaller resolutions like 256*256 or 512*512 it works but at some resolution it is Closed immediately after I called ReportOpenMediaCompleted.
I don’t get any Exceptions or such.

Here is my code:

public class BitmapStreamSource : MediaStreamSource
{
    MediaStreamDescription bitmapMediaStream;
    const int width = 1024;
    const int height = 1024;


    protected override void OpenMediaAsync()
    {
        Dictionary<MediaSourceAttributesKeys, string> mediaStreamAttributes;

        List<MediaStreamDescription> availableMediaStreams;
        Dictionary<MediaStreamAttributeKeys, string> bitmapStreamAttributes;


        mediaStreamAttributes = new Dictionary<MediaSourceAttributesKeys, string>(2);
        mediaStreamAttributes[MediaSourceAttributesKeys.CanSeek] = false.ToString();
        mediaStreamAttributes[MediaSourceAttributesKeys.Duration] = "-1";


        bitmapStreamAttributes = new Dictionary<MediaStreamAttributeKeys,string>(3);
        bitmapStreamAttributes[MediaStreamAttributeKeys.VideoFourCC]= "RGBA";
        bitmapStreamAttributes[MediaStreamAttributeKeys.Width]= width.ToString();
        bitmapStreamAttributes[MediaStreamAttributeKeys.Height] = height.ToString();

        bitmapMediaStream = new MediaStreamDescription(MediaStreamType.Video, bitmapStreamAttributes);
        availableMediaStreams = new List<MediaStreamDescription>(1);
        availableMediaStreams.Add(bitmapMediaStream);


        ReportOpenMediaCompleted(mediaStreamAttributes, availableMediaStreams);
    }

    protected override void SeekAsync(long seekToTime)
    {
        ReportSeekCompleted(seekToTime);
    }

    int sampleCount = 0;
    protected override void GetSampleAsync(MediaStreamType mediaStreamType)
    {
            int pixel = width * height;
            var buffer = new byte[pixel * 4];

            for (int i = 0; i < pixel; i++)
            {
                byte value = (byte)((i + sampleCount) % 256);

                var k = i * 4;
                //buffer[k] = 255; // B
                buffer[k + 1] = value; // G
                buffer[k + 2] = 255; // R
                //buffer[k + 3] = value; // A
            }


            var stream = new MemoryStream(buffer);

            var keys = new Dictionary<MediaSampleAttributeKeys, string>();
            var sample = new MediaStreamSample(bitmapMediaStream, stream, 0, buffer.Length, 0, keys);

            sampleCount++;
            ReportGetSampleCompleted(sample);
    }

    protected override void CloseMedia()
    {
        Debug.WriteLine("CloseMedia()");
    }

    protected override void GetDiagnosticAsync(MediaStreamSourceDiagnosticKind diagnosticKind)
    {
        throw new NotImplementedException();
    }

    protected override void SwitchMediaStreamAsync(MediaStreamDescription mediaStreamDescription)
    {
        throw new NotImplementedException();
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T12:59:49+00:00Added an answer on June 15, 2026 at 12:59 pm

    You are going beyond the media capabilities for your Windows Phone 7.x device (or emulator).

    In general the maximum resolution and which video codecs are supported depends on the SoC chip inside the phone and is documented here on MSDN for both Windows Phone 7.x and 8.0.

    In particular the chips inside Windows Phone 7.x handsets typically limit resolution at 1280×720 or 800×480 resolution. Windows Phone 8 handsets may support higher resolutions.

    If you are using the emulator this gets more complicated – it will typically simulate typical device capabilities, but you will need to test how media behaves on real devices to be sure.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying get some licensing code from AndroidPit.com working, but I get Unable to
I am trying get the parent folder of a Windows user's profile path. But
I am trying get all local machine services. But why are some services missing
I'm trying get url contents with file_get_contents(), its works in my localhost server, but
I am trying get the Regex right for the following scenario but have some
Well, I'm trying get some values from places.sqlite database. But when I do $
I am trying get Struts 2 and Tiles to work and I am using
Trying to get this expression to work, can someone look at it and tell
Hello everyone I been trying get php uploader working but having a lot of
I'm trying get LocalConnection to work between two swf's placed within two different IFRAMES.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.