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

  • SEARCH
  • Home
  • 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 4242954
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:30:45+00:00 2026-05-21T03:30:45+00:00

I have the next class, which is used to transmit RTP via audio or

  • 0

I have the next class, which is used to transmit RTP via audio or video files in Java.

So far so good.

What I want is to modify the UnicastRtp class to enable the transfer the screen, that is, you can use a medialocator like this:

MediaLocator new ("screen://0,0,1280,800/25")

I searched a lot on Internet and think the solution is to change the way you create and configure the processor.

In order to transmit the contents of the screen, it must be supported in StreamPantalla and DataSourcePantalla classes.

I developed a program that is able to display content in a player from an area of the screen (using the same StreamPantalla and DataSourcePantalla classes ), so I know they work well.

Now what I need is change the UnicastRtp class to be able to configure a processor for transmitting the contents of the screen.

Would appreciate any help or clues.

Thank you very much for the help.

Greetings!

  • 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-05-21T03:30:45+00:00Added an answer on May 21, 2026 at 3:30 am

    This is my solution:

    MediaLocator ml=new MediaLocator("screen://0,0,1280,800/25");
    
    DataSource clone=null;
    
    try {
            ds = new DataSourcePantalla();
            ds.setLocator(ml);
            clone = javax.media.Manager.createCloneableDataSource(ds);
    } catch (Exception e) {
            System.out.println(e.getMessage());
    }
    
    try {
            ds.connect();
            clone.connect();
    } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
    }
    Format[] outputFormat=new Format[1];
    FileTypeDescriptor outputType = new FileTypeDescriptor(FileTypeDescriptor.RAW_RTP);
    outputFormat[0]=new VideoFormat(VideoFormat.JPEG_RTP);
    ProcessorModel processorModel = new ProcessorModel(clone, outputFormat, outputType);
    
    // Try to create a processor to handle the input media locator
    try {
            processor = Manager.createRealizedProcessor(processorModel);
    } catch (NoProcessorException npe) {
            System.out.println(npe.getMessage());
    } catch (IOException ioe) {
            System.out.println(ioe.getMessage());
    } 
    catch (CannotRealizeException e) {
            // TODO Auto-generated catch block
            System.out.println(e.getMessage());
    }
    
    boolean result = waitForState(processor, Processor.Configured);
    if (result == false){
            System.out.println("Error, No se pudo configurar el processor en UnicastRtpPantalla::createMyProcessor");
            return false;
    }
    
    TrackControl[] tracks = processor.getTrackControls();
    // Search through the tracks for a video track
    for (int i = 0; i < tracks.length; i++) {
            Format format = tracks[i].getFormat();
            if (tracks[i].isEnabled() && format instanceof VideoFormat) {
    System.out.println("Pista "+i+" de video tiene formato: "+tracks[i].getFormat());
    // Found a video track. Try to program it to output JPEG/RTP
    // Make sure the sizes are multiple of 8's.
    float frameRate = 25;//((VideoFormat) format).getFrameRate();
    Dimension size = new Dimension(1280, 800);//((VideoFormat) format).getSize();
    int w = (size.width % 8 == 0 ? size.width: (int) (size.width / 8) * 8);
    int h = (size.height % 8 == 0 ? size.height: (int) (size.height / 8) * 8);
    VideoFormat jpegFormat = new VideoFormat(VideoFormat.JPEG_RTP,
    new Dimension(w, h), Format.NOT_SPECIFIED,
    Format.byteArray, frameRate);
    tracks[i].setFormat(jpegFormat);
    System.out.println("Pista "+i+" de video se cambió a formato: "+tracks[i].getFormat());
            } else
    tracks[i].setEnabled(false);
    }
    //              // Set the output content descriptor to RAW_RTP
    ContentDescriptor cd = new ContentDescriptor(ContentDescriptor.RAW_RTP);
    processor.setContentDescriptor(cd);
    
    ds = processor.getDataOutput();
    

    Regards!

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

Sidebar

Related Questions

Let's say I have a class which will be used to create either tree
I have the next code: class Printer{ Activity activity; public Printer (Activity activity) {
I have the next code : public class AddPrinter extends ListActivity { @Override public
I have next code require 'rack/rpc' class Server < Rack::RPC::Server def hello_world Hello, world!
I have next package structure webService.ear -- dependency.jar -- some.class Can I remove some.class
I have next tables Order , Transaction , Payment . Class Order has some
I have the next scenario: I define an int[][] variable in my main class.
How to select next n hidden elements that have class foo using jQuery?
I have next command in my batch script dir project\*.java /s /B > temp_file
I have a C# class which needs to process a sequence of items (

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.